* SG_GET_VERSION_NUM and SG_IO issue
@ 2008-07-08 0:59 Kantor Zsolt
2008-07-08 15:38 ` Douglas Gilbert
0 siblings, 1 reply; 2+ messages in thread
From: Kantor Zsolt @ 2008-07-08 0:59 UTC (permalink / raw)
To: linux-scsi
Hi, I have a strange problem with the SG_GET_VERSION_NUM, and the SG_IO ioctl
I have blacklisted and renamed all my SCSI subsystem drivers, so the kernel can't load them. I have checked with lsmod, and yes the drivers are not loaded. All my SCSI subsystem is compiled as modules for my running kernel (CONFIG_SCSI=m, CONFIG_CHR_DEV_SG=m, CONFIG_BLK_DEV_SD=m . . .), I checked that in the running kernel config file in the /boot directory.
In my initrd image the SCSI drivers are not present either.
Even so, if the SCSI susbsystem is not loaded at all I can execute successfully the SG_GET_VERSION_NUM ioctl and I can even send commands via the SG_IO ioctl. How is that possible if there are no SCSI drivers loaded ??
My kernel version is 2.6.18-6-k7 and I'm using Debian etch, if this information is helpful
Thanks,
Kantor
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: SG_GET_VERSION_NUM and SG_IO issue
2008-07-08 0:59 SG_GET_VERSION_NUM and SG_IO issue Kantor Zsolt
@ 2008-07-08 15:38 ` Douglas Gilbert
0 siblings, 0 replies; 2+ messages in thread
From: Douglas Gilbert @ 2008-07-08 15:38 UTC (permalink / raw)
To: kantorzsolt; +Cc: linux-scsi
Kantor Zsolt wrote:
> Hi, I have a strange problem with the SG_GET_VERSION_NUM, and the SG_IO ioctl
> I have blacklisted and renamed all my SCSI subsystem drivers, so the kernel can't load them. I have checked with lsmod, and yes the drivers are not loaded. All my SCSI subsystem is compiled as modules for my running kernel (CONFIG_SCSI=m, CONFIG_CHR_DEV_SG=m, CONFIG_BLK_DEV_SD=m . . .), I checked that in the running kernel config file in the /boot directory.
> In my initrd image the SCSI drivers are not present either.
> Even so, if the SCSI susbsystem is not loaded at all I can execute successfully the SG_GET_VERSION_NUM ioctl and I can even send commands via the SG_IO ioctl. How is that possible if there are no SCSI drivers loaded ??
> My kernel version is 2.6.18-6-k7 and I'm using Debian etch, if this information is helpful
That is because the SG_IO ioctl is implemented in the block
layer in block/scsi_ioctl.c (and earlier in
drivers/block/scsi_ioctl.c) which is outside the SCSI subsystem.
That code also "fakes" some of the sg driver's other ioctls such
as SG_GET_VERSION_NUM . [It only fakes the ones needed to fool
cdrecord, so try some other sg ioctls ...].
Interesting that there seems to be no way to turn off the SCSI
pass-through (or restrict it to CAP_SYS_RAWIO or root user)
with this design.
Doug Gilbert
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-08 15:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-08 0:59 SG_GET_VERSION_NUM and SG_IO issue Kantor Zsolt
2008-07-08 15:38 ` Douglas Gilbert
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.