I'm running Knoppix 3.6 on my laptop with Celeron P4 CPU.
I have compiled and installed the vanilla kernel 2.6.7 for this CPU. Then I have downloaded and compiled the cloop driver (source from www.knoppix.net) and loaded the driver with the original compressed KNOPPIX image. Then I tried to mount /dev/cloop which lead into a kernel oops (NULL pointer access). I have debugged the driver and found out that bvec (in function make_clo_request at line 362)
struct bio_vec *bvec=&bio->bi_io_vec[vecnr];
has an illegal value (0x00000001)! The weird thing is that this problem only occurs on my notebook. On my desktop PC (CPU is Athlon XP) the driver works fine. Maybe there is a problem with gcc.
I've added some lines to the driver to avoid a kernel oops. Ok, the driver still doesn't work, but for stability and security issues pointers should be checked for a valid value.
Here is the code (inserted after line 362:
if ((void *)bvec < (void *)0x80000000) {
printk(KERN_ERR "do_clo_request: bio->bi_io_vec[%i] has illegal value %p\n", vecnr, bvec);
break;
}
I don't know if the value 0x80000000 is a good choice. On Intel systems I think it is good. But there may be a better solution.
Wouldn't it be good to implement some pointer checking code?
Asus H110M-K LGA 1151 DDR4 USB 3.0 Micro ATX Intel Desktop Motherboard w/IO
$34.95
Gigabyte Z370P D3 ATX Z370 LGA1151 Motherboard (Support Intel 6/7th 8th 9th)
$59.99
ASRock B550M Pro SE AM4 DDR4 SATA 6Gb/s 1 PCIe 4.0 x16 Micro ATX Motherboard
$84.99
ASUS H110M-R Motherboard Intel 6th/7th Gen LGA1151 DDR4 Micro-ATX i/o shield
$42.00
Asus Prime H310M-A R2.0 Intel LGA 1151 DDR4 Desktop Motherboard
$54.99
Asus H81M-C Intel LGA1150 DDR3 Desktop Motherboard MicroATX Socket H3
$23.99
Asus Prime A320M-K mATX AM4 Motherboard (Ryzen 1000-5000 Ready)
$49.99
Gigabyte M-ATX motherboard with Intel Core i3 8100 CPU and 8GB DDR4 RAM
$84.00
ASUS PRIME Z690-P WIFI D4 ATX Motherboard Intel LGA1700 DDR4 HDMI
$99.99