A warning and an oops

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

A warning and an oops

jsavitz
Hi,

I was running mhvtl (compiled from latest source) on RHEL 8 (kernel 4.18) and I ran into two problems.

First, the kernel would complain about "Bad or missing usercopy whitelist" when issuing an ioctl during library initialization. This is reproducible using something like `vtllibrary -q 10` with mhvtl.ko loaded into the kernel.

Second, the kernel will oops when the daemon is quickly started and then stopped. This is reproducible using `vtllibrary -q 10; vtlcmd 10 exit` and appears to be due to a null pointer dereference that occurs a few instructions into [kernel_tree_root]/drivers/scsi/scsi_sysfs.c:scsi_remove_device(). Disassembly of the relevant kernel text implies that the function is passed a null pointer as the singular (struct scsi_device*) argument. I suspect that some kind of missing synchronization between ioctl()s is responsible.

I do have crash dumps available, but the reproduction of these bugs should be fairly straightforward.

Side note: I was entirely unable to compile mhvtl.ko on the latest upstream kernel (5.3-rc4 I believe it was at the time)

Best,
Joel Savitz | Red Hat