* sending ioctl warnings for a partition
@ 2012-02-04 16:05 Tullio Dovera
2012-02-04 18:28 ` Douglas Gilbert
0 siblings, 1 reply; 7+ messages in thread
From: Tullio Dovera @ 2012-02-04 16:05 UTC (permalink / raw)
To: linux-scsi
My platform is based on linux v3.2.2 + Debian stable zfs-fuse-0.6.9-1
application
When I use a dedicated scsi partition for zfs-fuse I see the following
warnings at kernel level:
kernel: [ 12.881949] zfs-fuse: sending ioctl 2285 to a partition!
The SG_IO is blocked inside scsi_verify_blk_ioctl() function. In order to permit
SG_IO for a partition I suggest to add it in the white list:
--- a/block/scsi_ioctl.c 2012-02-01 11:10:41.000000000 +0100
+++ b/block/scsi_ioctl.c 2012-02-01 11:31:09.000000000 +0100
@@ -710,6 +710,7 @@
case SG_GET_RESERVED_SIZE:
case SG_SET_RESERVED_SIZE:
case SG_EMULATED_HOST:
+ case SG_IO:
return 0;
case CDROM_GET_CAPABILITY:
/* Keep this until we remove the printk below. udev sends it
Best regards,
Tullio
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sending ioctl warnings for a partition
2012-02-04 16:05 sending ioctl warnings for a partition Tullio Dovera
@ 2012-02-04 18:28 ` Douglas Gilbert
2012-02-04 23:30 ` Paolo Bonzini
0 siblings, 1 reply; 7+ messages in thread
From: Douglas Gilbert @ 2012-02-04 18:28 UTC (permalink / raw)
To: Tullio Dovera; +Cc: linux-scsi
On 12-02-04 11:05 AM, Tullio Dovera wrote:
> My platform is based on linux v3.2.2 + Debian stable zfs-fuse-0.6.9-1
> application
>
> When I use a dedicated scsi partition for zfs-fuse I see the following
> warnings at kernel level:
>
> kernel: [ 12.881949] zfs-fuse: sending ioctl 2285 to a partition!
>
> The SG_IO is blocked inside scsi_verify_blk_ioctl() function. In order to permit
> SG_IO for a partition I suggest to add it in the white list:
>
> --- a/block/scsi_ioctl.c 2012-02-01 11:10:41.000000000 +0100
> +++ b/block/scsi_ioctl.c 2012-02-01 11:31:09.000000000 +0100
> @@ -710,6 +710,7 @@
> case SG_GET_RESERVED_SIZE:
> case SG_SET_RESERVED_SIZE:
> case SG_EMULATED_HOST:
> + case SG_IO:
> return 0;
> case CDROM_GET_CAPABILITY:
> /* Keep this until we remove the printk below. udev sends it
If I'm not mistaken, the whole point of a series of patches
titled: "fail SCSI passthrough ioctls on partition devices"
was to flag and ultimately break any user space code that
attempted to use the SG_IO ioctl on a partition block
device (e.g. send a SCSI INQUIRY via SG_IO to /dev/sda2).
This is for security reasons. So when the kernel enforces
that, zfs-fuse will break. Please alert the zfs-fuse
maintainers.
Doug Gilbert
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sending ioctl warnings for a partition
2012-02-04 18:28 ` Douglas Gilbert
@ 2012-02-04 23:30 ` Paolo Bonzini
2012-02-05 14:14 ` Paolo Bonzini
0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2012-02-04 23:30 UTC (permalink / raw)
To: linux-scsi, tdovera, zfs-fuse
On 02/04/2012 07:28 PM, Douglas Gilbert wrote:
>
> If I'm not mistaken, the whole point of a series of patches
> titled: "fail SCSI passthrough ioctls on partition devices"
> was to flag and ultimately break any user space code that
> attempted to use the SG_IO ioctl on a partition block
> device (e.g. send a SCSI INQUIRY via SG_IO to /dev/sda2).
>
> This is for security reasons. So when the kernel enforces
> that, zfs-fuse will break. Please alert the zfs-fuse
> maintainers.
That's correct. zfs-fuse is trying to send a SYNCHRONIZE CACHE command,
they should just use BLKFLSBUF (which will also give a warning due to a
quirk in block/ioctl.c, but it's a false positive and the warning will
go away soonish).
In principle, SYNCHRONIZE CACHE is "safe" even if sent to a partition
and doesn't really leak anything, but I'm not sure we want to look into
the CDB in scsi_ioctl.c.
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sending ioctl warnings for a partition
2012-02-04 23:30 ` Paolo Bonzini
@ 2012-02-05 14:14 ` Paolo Bonzini
2012-02-07 16:34 ` Tullio Dovera
0 siblings, 1 reply; 7+ messages in thread
From: Paolo Bonzini @ 2012-02-05 14:14 UTC (permalink / raw)
Cc: linux-scsi, tdovera, zfs-fuse
On 02/05/2012 12:30 AM, Paolo Bonzini wrote:
> That's correct. zfs-fuse is trying to send a SYNCHRONIZE CACHE command,
> they should just use BLKFLSBUF (which will also give a warning due to a
> quirk in block/ioctl.c, but it's a false positive and the warning will
> go away soonish).
Not even that. All that is needed is fsync.
Paolo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sending ioctl warnings for a partition
2012-02-05 14:14 ` Paolo Bonzini
@ 2012-02-07 16:34 ` Tullio Dovera
0 siblings, 0 replies; 7+ messages in thread
From: Tullio Dovera @ 2012-02-07 16:34 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: linux-scsi, zfs-fuse
Thank you very much. I have opened an issue in zfs-fuse project.
Tullio
On Sun, Feb 5, 2012 at 3:14 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 02/05/2012 12:30 AM, Paolo Bonzini wrote:
>>
>> That's correct. zfs-fuse is trying to send a SYNCHRONIZE CACHE command,
>> they should just use BLKFLSBUF (which will also give a warning due to a
>> quirk in block/ioctl.c, but it's a false positive and the warning will
>> go away soonish).
>
>
> Not even that. All that is needed is fsync.
>
> Paolo
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sending ioctl warnings for a partition
@ 2012-02-27 10:48 Milan Knížek
2012-02-28 20:48 ` Tullio Dovera
0 siblings, 1 reply; 7+ messages in thread
From: Milan Knížek @ 2012-02-27 10:48 UTC (permalink / raw)
To: linux-scsi
Hello Tullio,
can you pls point me where in zfs-fuse project is the issue reported?
I have not found anything in zfs-fuse @ googlegroups and
http://zfs-fuse.net/issues
Thank you and regards,
Milan
--
To: Paolo Bonzini <pbonzini@xxxxxxxxxx>
Subject: Re: sending ioctl warnings for a partition
From: Tullio Dovera <tdovera@xxxxxxxxx>
Date: Tue, 7 Feb 2012 17:34:58 +0100
Cc: linux-scsi <linux-scsi@xxxxxxxxxxxxxxx>, zfs-fuse@xxxxxxx
In-reply-to: <4F2E8EB3.3010307@redhat.com>
Thank you very much. I have opened an issue in zfs-fuse project.
Tullio
On Sun, Feb 5, 2012 at 3:14 PM, Paolo Bonzini <pbonzini@xxxxxxxxxx>
wrote:
> On 02/05/2012 12:30 AM, Paolo Bonzini wrote:
>>
>> That's correct. zfs-fuse is trying to send a SYNCHRONIZE CACHE
>> command, they should just use BLKFLSBUF (which will also give a
>> warning due to a quirk in block/ioctl.c, but it's a false positive
>> and the warning will go away soonish).
>
>
> Not even that. All that is needed is fsync.
>
> Paolo
--
http://www.milan-knizek.net/
About linux and photography (Czech only)
O linuxu a fotografování
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: sending ioctl warnings for a partition
2012-02-27 10:48 Milan Knížek
@ 2012-02-28 20:48 ` Tullio Dovera
0 siblings, 0 replies; 7+ messages in thread
From: Tullio Dovera @ 2012-02-28 20:48 UTC (permalink / raw)
To: Milan Knížek; +Cc: linux-scsi
Dear Milan,
I have reopened the issue because I can't find it in zfs-fuse project.
The issue is #143
Best regards,
Tullio
On Mon, Feb 27, 2012 at 11:48 AM, Milan Knížek <knizek.confy@gmail.com> wrote:
>
> Hello Tullio,
>
> can you pls point me where in zfs-fuse project is the issue reported?
>
> I have not found anything in zfs-fuse @ googlegroups and
> http://zfs-fuse.net/issues
>
> Thank you and regards,
> Milan
>
> --
>
> To: Paolo Bonzini <pbonzini@xxxxxxxxxx>
> Subject: Re: sending ioctl warnings for a partition
> From: Tullio Dovera <tdovera@xxxxxxxxx>
> Date: Tue, 7 Feb 2012 17:34:58 +0100
> Cc: linux-scsi <linux-scsi@xxxxxxxxxxxxxxx>, zfs-fuse@xxxxxxx
> In-reply-to: <4F2E8EB3.3010307@redhat.com>
> Thank you very much. I have opened an issue in zfs-fuse project.
>
> Tullio
>
> On Sun, Feb 5, 2012 at 3:14 PM, Paolo Bonzini <pbonzini@xxxxxxxxxx>
> wrote:
> > On 02/05/2012 12:30 AM, Paolo Bonzini wrote:
> >>
> >> That's correct. zfs-fuse is trying to send a SYNCHRONIZE CACHE
> >> command, they should just use BLKFLSBUF (which will also give a
> >> warning due to a quirk in block/ioctl.c, but it's a false positive
> >> and the warning will go away soonish).
> >
> >
> > Not even that. All that is needed is fsync.
> >
> > Paolo
>
> --
> http://www.milan-knizek.net/
> About linux and photography (Czech only)
> O linuxu a fotografování
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-02-28 20:48 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-04 16:05 sending ioctl warnings for a partition Tullio Dovera
2012-02-04 18:28 ` Douglas Gilbert
2012-02-04 23:30 ` Paolo Bonzini
2012-02-05 14:14 ` Paolo Bonzini
2012-02-07 16:34 ` Tullio Dovera
-- strict thread matches above, loose matches on Subject: below --
2012-02-27 10:48 Milan Knížek
2012-02-28 20:48 ` Tullio Dovera
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox