From: Douglas Gilbert <dougg@torque.net>
To: kantorzsolt@yahoo.com
Cc: linux-scsi@vger.kernel.org
Subject: Re: SG_GET_VERSION_NUM and SG_IO issue
Date: Tue, 08 Jul 2008 11:38:34 -0400 [thread overview]
Message-ID: <487389FA.9000006@torque.net> (raw)
In-Reply-To: <670709.40869.qm@web35402.mail.mud.yahoo.com>
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
prev parent reply other threads:[~2008-07-08 15:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-08 0:59 SG_GET_VERSION_NUM and SG_IO issue Kantor Zsolt
2008-07-08 15:38 ` Douglas Gilbert [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=487389FA.9000006@torque.net \
--to=dougg@torque.net \
--cc=kantorzsolt@yahoo.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.