[PATCH v3 part1 4/4] sg_io: resolve conflicts between commands assigned to multiple classes (CVE-2012-4542)

2013-05-23 Thread Paolo Bonzini
change that fixes this bug. Cc: sta...@gnu.org Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/scsi_ioctl.c | 26 ++ 1 file changed, 26 insertions

[PATCH v3 part3 1/7] sg_io: complete transition to per-class lists of allowed commands

2013-05-23 Thread Paolo Bonzini
-standard spacing. IMO the improved readability trumps the problems reported by checkpatch. Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/scsi_ioctl.c | 207

[PATCH v3 part3 3/7] sg_io: cleanup and complete whitelist for rare device types

2013-05-23 Thread Paolo Bonzini
jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/scsi_ioctl.c | 41 - 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/block/scsi_ioctl.c b/block

[PATCH v3 part3 5/7] sg_io: cleanup and complete whitelist for media changers

2013-05-23 Thread Paolo Bonzini
WITH RANGE, which is enabled as well. This makes media changers usable by unprivileged users that have access to the device node. Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block

[PATCH v3 part3 6/7] sg_io: cleanup and complete whitelist for tapes

2013-05-23 Thread Paolo Bonzini
-byte CDBs for READ and WRITE. For this reason I'm separating block devices for tapes entirely. Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/scsi_ioctl.c | 47

[PATCH v3 part3 7/7] sg_io: cleanup and complete whitelist for disks

2013-05-23 Thread Paolo Bonzini
: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/scsi_ioctl.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index 0bf0820..216cd17 100644 --- a/block/scsi_ioctl.c +++ b/block

[PATCH v3 part3 4/7] sg_io: whitelist another command for multimedia devices

2013-05-23 Thread Paolo Bonzini
. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/scsi_ioctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index 41bbd93..b11ad49 100644 --- a/block

[PATCH v3 part3 2/7] sg_io: create separate entries for conflicting commands

2013-05-23 Thread Paolo Bonzini
read-write. The other four conflicting commands have their bitmap entries split in two parts, one read-only for MMC and one read-write for the other classes. Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini

[PATCH v3 part1 2/4] sg_io: prepare to introduce per-class command filters

2013-05-23 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/scsi_ioctl.c | 148 +++-- 1 file changed, 76 insertions(+), 72 deletions(-) diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index 96cab50..21ddf17 100644 --- a/block/scsi_ioctl.c +++ b/block

[PATCH v3 part2] Add per-device sysfs knob to enable unrestricted, unprivileged SG_IO

2013-05-23 Thread Paolo Bonzini
filtering. This queue flag can then be set on selected devices. This patch depends on, and conflicts with, the CVE-2012-4542 fix that I have just sent. Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini

[PATCH v3 part1 1/4] sg_io: pass request_queue to blk_verify_command

2013-05-23 Thread Paolo Bonzini
...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/bsg.c| 2 +- block/scsi_ioctl.c | 7 --- drivers/scsi/sg.c | 3 ++- include/linux/blkdev.h | 3 ++- 4 files changed, 9 insertions(+), 6 deletions

PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Paolo Bonzini
I'm not sure what is more ridiculous, whether the seven pings or the lack of review... Paolo Il 06/02/2013 16:15, Paolo Bonzini ha scritto: This series regards the whitelist that is used for the SG_IO ioctl. This whitelist has three problems: * the bitmap of allowed commands is designed

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Paolo Bonzini
Il 22/05/2013 11:32, Tejun Heo ha scritto: On Wed, May 22, 2013 at 08:35:54AM +0200, Paolo Bonzini wrote: I'm not sure what is more ridiculous, whether the seven pings or the lack of review... So, ummm, I don't know what Jens is thinking but at this point I'm basically waiting for someone

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Paolo Bonzini
Il 22/05/2013 12:02, Tejun Heo ha scritto: On Wed, May 22, 2013 at 11:53:30AM +0200, Paolo Bonzini wrote: Il 22/05/2013 11:32, Tejun Heo ha scritto: On Wed, May 22, 2013 at 08:35:54AM +0200, Paolo Bonzini wrote: I'm not sure what is more ridiculous, whether the seven pings or the lack

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Paolo Bonzini
OK, let me try. I did draw straws with Jens at LSF to see who would look at this and he lost, but the complexity of the patch set probably makes it hard for him to find the time. Thanks. The first problem, which Tejun already pointed out is that you've combined a bug fix with a large

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Paolo Bonzini
Il 22/05/2013 15:41, Tejun Heo ha scritto: On Wed, May 22, 2013 at 12:23:56PM +0200, Paolo Bonzini wrote: Yes, because I have no idea what _your_ point is. Isolate the actual fixes and just submit them as it seems impossible for you to provide proper justifications for the things you want

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Paolo Bonzini
Il 22/05/2013 16:30, Tejun Heo ha scritto: * Separate fixes from additions. Transform existing code so that the visible behavior doesn't change but the required fix can be implemented on top. Explicitly note what's going on in the commit messages. Been there, done that. Have you read

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Paolo Bonzini
Il 22/05/2013 17:03, Theodore Ts'o ha scritto: Paolo, I'll probably regret butting my head into this, but it might be helpful if you talk about your particular use case which is driving your desire to make these changes. Ted, thank you very much. I understand that my discussion with Tejun

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Paolo Bonzini
Il 22/05/2013 16:07, Paolo Bonzini ha scritto: Finally, the patch for the feature I think you actually want, which is 13/14, could have been implemented fairly simply as a single patch and doesn't have to be part of this series. It was, and it was ignored. I sent it together because

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Paolo Bonzini
Il 22/05/2013 18:32, Martin K. Petersen ha scritto: Paolo == Paolo Bonzini pbonz...@redhat.com writes: Paolo First of all, I'll note that SG_IO and block-device-specific Paolo ioctls both have their place. My usecase for SG_IO is Paolo virtualization, where I need to pass information from

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Paolo Bonzini
Il 22/05/2013 20:11, Theodore Ts'o ha scritto: On Wed, May 22, 2013 at 07:00:14PM +0200, Paolo Bonzini wrote: You have hardware providers selling cloud services that want to run their own custom backup services from within a VM, which entails having vendor-specific commands run from within

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Paolo Bonzini
Il 22/05/2013 22:19, Theodore Ts'o ha scritto: On Wed, May 22, 2013 at 09:37:54PM +0200, Paolo Bonzini wrote: If it's not theoretical, how does the cloud service control who has access to the CD burner, and how are the disks loaded into the CD burner? CD burning would be used in a VM

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Paolo Bonzini
Il 22/05/2013 22:39, Tejun Heo ha scritto: Hey, On Wed, May 22, 2013 at 05:53:34PM +0200, Paolo Bonzini wrote: I do listen to review feedback, but I also expect the other side to listen to me, ask me what is not clear, and possess some knowledge of the domain that he's reviewing patches

Re: PING^7 (was Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542))

2013-05-22 Thread Paolo Bonzini
Il 22/05/2013 21:30, Tejun Heo ha scritto: The thing is that the behavior change is now implemented in an inactive form by #2 and then flipped on by #3. #2 both change the format and the content of the table. This should have been like the following. #2: Convert to the new table for mat

Re: [GIT PULL] Final round of SCSI updates for the 3.9+ merge window

2013-05-12 Thread Paolo Bonzini
Il 11/05/2013 01:00, James Bottomley ha scritto: This is the final round of SCSI patches for the merge window. It consists mostly of driver updates (bnx2fc, ibmfc, fnic, lpfc, be2iscsi, pm80xx, qla4x and ipr). There's also the power management updates that complete the patches in Jens' tree,

PING^6 Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542)

2013-05-06 Thread Paolo Bonzini
Il 20/02/2013 17:12, Paolo Bonzini ha scritto: Il 06/02/2013 16:15, Paolo Bonzini ha scritto: This series regards the whitelist that is used for the SG_IO ioctl. This whitelist has three problems: * the bitmap of allowed commands is designed for MMC devices (roughly, play/burn CDs without

Re: T10 WCE interpretation in Linux device level access

2013-04-27 Thread Paolo Bonzini
Il 25/04/2013 03:32, Martin K. Petersen ha scritto: I'm ok with your patch. And a strong believer in not altering the SYNCHRONIZE CACHE behavior that's been rigorously tested in the field by adding SYNC_NV to the mix. SYNC_NV is absolutely necessary for targets that (a) have both volatile and

PING^5 aka New ways to attract attentions Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542)

2013-04-27 Thread Paolo Bonzini
PING^5 So a blatant attempt at getting attention from LWN didn't work. I'm desperate, so... ... look! I'm top posting! Paolo Il 17/04/2013 14:26, Paolo Bonzini ha scritto: And a fourth ping comes... Jon, the next time I read it seems likely to be picked up fairly soon (http://lwn.net

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Paolo Bonzini
Il 23/04/2013 22:07, James Bottomley ha scritto: On Tue, 2013-04-23 at 15:41 -0400, Ric Wheeler wrote: For many years, we have used WCE as an indication that a device has a volatile write cache (not just a write cache) and used this as a trigger to send down SYNCHRONIZE_CACHE commands as

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Paolo Bonzini
Il 24/04/2013 14:07, Hannes Reinecke ha scritto: On 04/24/2013 01:17 PM, Paolo Bonzini wrote: Il 23/04/2013 22:07, James Bottomley ha scritto: On Tue, 2013-04-23 at 15:41 -0400, Ric Wheeler wrote: For many years, we have used WCE as an indication that a device has a volatile write cache

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Paolo Bonzini
Il 24/04/2013 14:12, Hannes Reinecke ha scritto: On 04/24/2013 02:08 PM, Paolo Bonzini wrote: Il 24/04/2013 14:07, Hannes Reinecke ha scritto: On 04/24/2013 01:17 PM, Paolo Bonzini wrote: Il 23/04/2013 22:07, James Bottomley ha scritto: On Tue, 2013-04-23 at 15:41 -0400, Ric Wheeler wrote

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Paolo Bonzini
no access to these controllers, neither the good ones nor the bad ones. :) Paolo - 8 - From: Paolo Bonzini pbonz...@redhat.com Subject: [PATCH] scsi: only make REQ_FLUSH flush to non-volatile cache The point of REQ_FLUSH is to have a crash-proof version

Re: T10 WCE interpretation in Linux device level access

2013-04-24 Thread Paolo Bonzini
Il 24/04/2013 23:02, James Bottomley ha scritto: That just leaves us with random standards behaviour. Lets permit the deterministic thing instead for the distros. It kills two birds with one stone because we can set WCE for the stupid UAS devices that clear it wrongly as well. For those

PING^4 aka The Jon Corbet Effect Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542)

2013-04-17 Thread Paolo Bonzini
And a fourth ping comes... Jon, the next time I read it seems likely to be picked up fairly soon (http://lwn.net/Articles/535075/), I'll picture the author of the patch attempting open-heart surgery on a long-red-haired voodoo doll! Paolo Il 04/04/2013 20:18, Paolo Bonzini ha scritto: Il 22/03

PING^3 Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542)

2013-04-04 Thread Paolo Bonzini
Il 22/03/2013 23:30, Paolo Bonzini ha scritto: Il 20/02/2013 17:12, Paolo Bonzini ha scritto: Il 06/02/2013 16:15, Paolo Bonzini ha scritto: This series regards the whitelist that is used for the SG_IO ioctl. This whitelist has three problems: * the bitmap of allowed commands is designed

Re: [PATCH V7 4/5] virtio-scsi: introduce multiqueue support

2013-03-25 Thread Paolo Bonzini
Il 25/03/2013 08:25, Bart Van Assche ha scritto: +queue_num = smp_processor_id(); +while (unlikely(queue_num = vscsi-num_queues)) +queue_num -= vscsi-num_queues; + +tgt-req_vq = vq = vscsi-req_vqs[queue_num]; +} + +

Re: [PATCH V6 5/5] virtio-scsi: reset virtqueue affinity when doing cpu hotplug

2013-03-23 Thread Paolo Bonzini
Il 20/03/2013 08:56, Wanlong Gao ha scritto: This one does not apply on top of virtio-next + patch 1-4 in this series. I'm very sorry. This fault is because I modified the 4/5 from /* if the affinity hint is set for virtqueues */ to /* If the affinity hint is set for virtqueues */ by

PING^2 Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542)

2013-03-22 Thread Paolo Bonzini
Il 20/02/2013 17:12, Paolo Bonzini ha scritto: Il 06/02/2013 16:15, Paolo Bonzini ha scritto: This series regards the whitelist that is used for the SG_IO ioctl. This whitelist has three problems: * the bitmap of allowed commands is designed for MMC devices (roughly, play/burn CDs without

Re: [PATCH V5 4/5] virtio-scsi: introduce multiqueue support

2013-03-20 Thread Paolo Bonzini
Il 20/03/2013 02:46, Venkatesh Srinivas ha scritto: This looks pretty good! I rather like the (lack of) locking in I/O completion (around the req count vs. target/queue binding). It is unfortunate that you need to hold the per-target lock in virtscsi_pick_vq() though; have any idea how much

Re: [PATCH V5 1/5] virtio-scsi: redo allocation of target data

2013-03-19 Thread Paolo Bonzini
Il 19/03/2013 12:32, James Bottomley ha scritto: On Tue, 2013-03-19 at 17:57 +0800, Wanlong Gao wrote: From: Paolo Bonzini pbonz...@redhat.com virtio_scsi_target_state is now empty. We will find new uses for it in the next few patches, so this patch does not drop it completely. However

Re: [PATCH V4 1/5] virtio-scsi: redo allocation of target data

2013-03-11 Thread Paolo Bonzini
at the end of struct virtio_scsi. But we do not do that, because we will place the virtqueues there in the next patches. Paolo Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com -- To unsubscribe from this list

Re: [GIT PULL] Final round of SCSI updates for the 3.8+ merge window

2013-03-01 Thread Paolo Bonzini
Il 01/03/2013 14:27, Douglas Gilbert ha scritto: What is the status of the: - scsi: 64-bit LUN support [v2] - SG_SCSI_RESET ioctl: add no_escalate values [v2] patches? Also: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542) Paolo -- To

Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542)

2013-02-20 Thread Paolo Bonzini
Il 06/02/2013 16:15, Paolo Bonzini ha scritto: This series regards the whitelist that is used for the SG_IO ioctl. This whitelist has three problems: * the bitmap of allowed commands is designed for MMC devices (roughly, play/burn CDs without requiring root) but some opcodes overlap

Re: [PATCH v3 0/5] virtio-scsi multiqueue

2013-02-18 Thread Paolo Bonzini
Il 18/02/2013 10:32, Wanlong Gao ha scritto: Ok for 3.9? It would probably be easier to get it in via Rusty's tree because of the prerequisites. James, can I get your Acked-by? I can't apply this series on top of Rusty's virtio-next, I missed something or needed rebase them ? It's on top

Re: [PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542)

2013-02-13 Thread Paolo Bonzini
Il 13/02/2013 16:35, Douglas Gilbert ha scritto: Ping? I'm not even sure what tree this should host these patches... You are whitelisting SCSI commands so obviously the SCSI tree and the patch spills over into the block tree. Yeah, an Acked-by is in order but it's not clear from whom and

[PATCH v3 1/5] virtio-scsi: redo allocation of target data

2013-02-12 Thread Paolo Bonzini
array member at the end of struct virtio_scsi, because we will place the virtqueues there in the next patches. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 39 --- 1 files changed, 12 insertions

[PATCH v3 2/5] virtio-scsi: pass struct virtio_scsi to virtqueue completion function

2013-02-12 Thread Paolo Bonzini
This will be needed soon in order to retrieve the per-target struct. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 17 + 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c

[PATCH v3 4/5] virtio-scsi: introduce multiqueue support

2013-02-12 Thread Paolo Bonzini
-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 269 +++- 1 files changed, 240 insertions(+), 29 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 3d77210..a2bdae1 100644 --- a/drivers/scsi

[PATCH v3 3/5] virtio-scsi: push vq lock/unlock into virtscsi_vq_done

2013-02-12 Thread Paolo Bonzini
Avoid duplicated code in all of the callers. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 22 +- 1 files changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi

[PATCH v3 5/5] virtio-scsi: reset virtqueue affinity when doing cpu hotplug

2013-02-12 Thread Paolo Bonzini
__virtscsi_set_affinity - Paolo ] Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 31 +++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index a2bdae1..733307a 100644 --- a/drivers

[PATCH v3 0/5] virtio-scsi multiqueue

2013-02-12 Thread Paolo Bonzini
probably be easier to get it in via Rusty's tree because of the prerequisites. James, can I get your Acked-by? Paolo Paolo Bonzini (4): virtio-scsi: redo allocation of target data virtio-scsi: pass struct virtio_scsi to virtqueue completion function virtio-scsi: push vq lock/unlock

[PATCH v2 00/14] Corrections and customization of the SG_IO command whitelist (CVE-2012-4542)

2013-02-06 Thread Paolo Bonzini
the large #if 0'd list of commands that the kernel does not pass though. Marked blk_set_cmd_filter_defaults as __init. Paolo Bonzini (14): sg_io: pass request_queue to blk_verify_command sg_io: reorganize list of allowed commands sg_io: use different default filters for each device

[PATCH v2 14/14] sg_io: use unpriv_sgio to disable whitelisting for scanners

2013-02-06 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/scsi_scan.c | 12 +++- drivers/scsi/sg.c|3 --- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 86940f3..702b0ef 100644 --- a/drivers/scsi

[PATCH v2 12/14] sg_io: remove remnants of sysfs SG_IO filters

2013-02-06 Thread Paolo Bonzini
Some defines and structs remained when support was removed for SG_IO filters in sysfs. Remove them. Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- include/linux/genhd.h |9

[PATCH v2 13/14] sg_io: introduce unpriv_sgio queue flag

2013-02-06 Thread Paolo Bonzini
permissions. Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- Documentation/block/queue-sysfs.txt |8 block/blk-sysfs.c | 33

[PATCH v2 09/14] sg_io: whitelist a few more commands for disks

2013-02-06 Thread Paolo Bonzini
-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: leave out the commands listed in the commit message block/scsi_ioctl.c | 17 +++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index a9c2caf..e100ee3 100644 --- a/block

[PATCH v2 04/14] sg_io: resolve conflicts between commands assigned to multiple classes (CVE-2012-4542)

2013-02-06 Thread Paolo Bonzini
: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/scsi_ioctl.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/block/scsi_ioctl.c b/block

[PATCH v2 08/14] sg_io: whitelist a few more commands for tapes

2013-02-06 Thread Paolo Bonzini
: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/scsi_ioctl.c | 30 +- 1 files changed, 25 insertions(+), 5 deletions(-) diff --git a/block

[PATCH v2 07/14] sg_io: whitelist a few more commands for media changers

2013-02-06 Thread Paolo Bonzini
...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/scsi_ioctl.c | 21 - 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index fa2a1fc..8cda426 100644 --- a/block/scsi_ioctl.c +++ b/block/scsi_ioctl.c

[PATCH v2 06/14] sg_io: whitelist another command for multimedia devices

2013-02-06 Thread Paolo Bonzini
...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: leave out PLAY AUDIO(12), SERVICE ACTION IN(12) block/scsi_ioctl.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c index e71cd42..fa2a1fc 100644

[PATCH v2 10/14] sg_io: whitelist a few obsolete commands

2013-02-06 Thread Paolo Bonzini
These are added to their own section of the table, together with SEEK(10) which has always been permitted. Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/scsi_ioctl.c

[PATCH v2 03/14] sg_io: use different default filters for each device class

2013-02-06 Thread Paolo Bonzini
@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/scsi_ioctl.c | 14 +- drivers/scsi/scsi_scan.c |2 ++ include/linux/blkdev.h |2 +- include/scsi/scsi.h |1 + 4 files changed, 9 insertions(+), 10

[PATCH v2 02/14] sg_io: reorganize list of allowed commands

2013-02-06 Thread Paolo Bonzini
Axboe ax...@kernel.dk Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: do not use C++ commands, add definitions for missing types in include/scsi/scsi.h block/scsi_ioctl.c | 210 --- include/scsi/scsi.h |2

Re: [PATCH 2/2] virtio-scsi: reset virtqueue affinity when doing cpu hotplug

2013-02-06 Thread Paolo Bonzini
Il 16/01/2013 04:55, Wanlong Gao ha scritto: Add hot cpu notifier to reset the request virtqueue affinity when doing cpu hotplug. You need to be careful to get_online_cpus() and put_online_cpus() here, so CPUs can't go up and down in the middle of operations. In particular,

Re: [PATCH 0/3] target: Fix zero-length regressions in v3.8-rc1 code

2013-01-30 Thread Paolo Bonzini
Il 29/01/2013 23:26, Nicholas A. Bellinger ha scritto: From: Nicholas Bellinger n...@linux-iscsi.org Hi folks, The following are a handful of zero-length CDB regression bugfixes to address breakage introduced by the recent sense_reason_t conversion in v3.8-rc1 code, which incorrectly

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2013-01-10 Thread Paolo Bonzini
Il 08/01/2013 01:12, Rusty Russell ha scritto: Unfortunately, that cannot work because not all architectures support chained scatterlists. WHAT? I can't figure out what an arch needs to do to support this? It needs to use the iterator functions in its DMA driver. But we don't care

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2013-01-07 Thread Paolo Bonzini
Il 07/01/2013 01:02, Rusty Russell ha scritto: Paolo Bonzini pbonz...@redhat.com writes: Il 02/01/2013 06:03, Rusty Russell ha scritto: Paolo Bonzini pbonz...@redhat.com writes: The virtqueue_add_buf function has two limitations: 1) it requires the caller to provide all the buffers

Ping^2 Re: [PATCH v3 0/2] add per-device sysfs knob to enable unrestricted, unprivileged SG_IO

2013-01-04 Thread Paolo Bonzini
Il 17/12/2012 15:27, Paolo Bonzini ha scritto: Il 13/11/2012 18:25, Paolo Bonzini ha scritto: Privilege restrictions for SG_IO right now apply without distinction to all devices, based on the single capability CAP_SYS_RAWIO. This is a very broad capability, and makes it difficult to give

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2013-01-03 Thread Paolo Bonzini
Il 02/01/2013 06:03, Rusty Russell ha scritto: Paolo Bonzini pbonz...@redhat.com writes: The virtqueue_add_buf function has two limitations: 1) it requires the caller to provide all the buffers in a single call; 2) it does not support chained scatterlists: the buffers must be provided

Re: [PATCH v2 0/5] Multiqueue virtio-scsi, and API for piecewise buffer submission

2012-12-19 Thread Paolo Bonzini
Il 18/12/2012 23:18, Rolf Eike Beer ha scritto: Paolo Bonzini wrote: Hi all, this series adds multiqueue support to the virtio-scsi driver, based on Jason Wang's work on virtio-net. It uses a simple queue steering algorithm that expects one queue per CPU. LUNs in the same target always

[PATCH v2 5/5] virtio-scsi: introduce multiqueue support

2012-12-18 Thread Paolo Bonzini
because we do not set the affinity directly---we only provide a hint to the irqbalanced running in userspace. Dynamically changing the affinity only works if the userspace applies the hint fast enough. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: improved comments and commit

[PATCH v2 2/5] virtio-scsi: use functions for piecewise composition of buffers

2012-12-18 Thread Paolo Bonzini
in this patches and in the next ones. Signed-off-by: Wanlong Gao gaowanl...@cn.fujitsu.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: new drivers/scsi/virtio_scsi.c | 94 +++ 1 files changed, 42 insertions(+), 52 deletions(-) diff

[PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2012-12-18 Thread Paolo Bonzini
is not needed in virtio-blk, because it does all the work of the upper SCSI layers itself in the blk_map_rq_sg call. Then it simply hands the resulting scatterlist to virtqueue_add_buf. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: new drivers/virtio/virtio_ring.c | 205

[PATCH v2 4/5] virtio-scsi: pass struct virtio_scsi to virtqueue completion function

2012-12-18 Thread Paolo Bonzini
This will be needed soon in order to retrieve the per-target struct. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 17 + 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c

[PATCH v2 0/5] Multiqueue virtio-scsi, and API for piecewise buffer submission

2012-12-18 Thread Paolo Bonzini
. Paolo Bonzini (5): virtio: add functions for piecewise addition of buffers virtio-scsi: use functions for piecewise composition of buffers virtio-scsi: redo allocation of target data virtio-scsi: pass struct virtio_scsi to virtqueue completion function virtio-scsi: introduce multiqueue

Re: [PATCH v2 2/5] virtio-scsi: use functions for piecewise composition of buffers

2012-12-18 Thread Paolo Bonzini
Il 18/12/2012 14:37, Michael S. Tsirkin ha scritto: On Tue, Dec 18, 2012 at 01:32:49PM +0100, Paolo Bonzini wrote: Using the new virtio_scsi_add_sg function lets us simplify the queueing path. In particular, all data protected by the tgt_lock is just gone (multiqueue will find a new use

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2012-12-18 Thread Paolo Bonzini
Il 18/12/2012 14:36, Michael S. Tsirkin ha scritto: Some comments without arguing about whether the performance benefit is worth it. On Tue, Dec 18, 2012 at 01:32:48PM +0100, Paolo Bonzini wrote: diff --git a/include/linux/virtio.h b/include/linux/virtio.h index cf8adb1..39d56c4 100644

Re: [PATCH v2 5/5] virtio-scsi: introduce multiqueue support

2012-12-18 Thread Paolo Bonzini
Il 18/12/2012 14:57, Michael S. Tsirkin ha scritto: -static int virtscsi_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *sc) +static int virtscsi_queuecommand(struct virtio_scsi *vscsi, + struct virtio_scsi_target_state *tgt, +

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2012-12-18 Thread Paolo Bonzini
Il 18/12/2012 14:59, Michael S. Tsirkin ha scritto: Can't we track state internally to the virtqueue? Exposing it seems to buy us nothing since you can't call add_buf between start and end anyway. I wanted to keep the state for these functions separate from the rest. I don't think it makes

Re: [PATCH v2 5/5] virtio-scsi: introduce multiqueue support

2012-12-18 Thread Paolo Bonzini
Il 18/12/2012 16:03, Michael S. Tsirkin ha scritto: On Tue, Dec 18, 2012 at 03:08:08PM +0100, Paolo Bonzini wrote: Il 18/12/2012 14:57, Michael S. Tsirkin ha scritto: -static int virtscsi_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *sc) +static int virtscsi_queuecommand(struct

Re: [PATCH v3 0/2] add per-device sysfs knob to enable unrestricted, unprivileged SG_IO

2012-12-17 Thread Paolo Bonzini
Il 13/11/2012 18:25, Paolo Bonzini ha scritto: Privilege restrictions for SG_IO right now apply without distinction to all devices, based on the single capability CAP_SYS_RAWIO. This is a very broad capability, and makes it difficult to give SG_IO access to trusted clients that need access

Re: [PATCH] scsi_ram: a RAM-based SCSI driver

2012-12-07 Thread Paolo Bonzini
Il 07/12/2012 12:20, Kirill A. Shutemov ha scritto: Is this that much faster than scsi-debug? The discarding options surely can be added there. scsi_ram is about 9% faster (without fake_rw/throw_away_*) on my machine: There are two main differences in the data path: - scsi_debug uses

Re: [PATCH] scsi_ram: a RAM-based SCSI driver

2012-12-06 Thread Paolo Bonzini
Il 05/12/2012 17:45, Kirill A. Shutemov ha scritto: From: Kirill A. Shutemov kirill.shute...@linux.intel.com This driver is intended to run as fast as possible, hence the options to discard writes and reads. It's designed to let us find latency issues elsewhere in the storage stack (eg

Re: [PATCH 3/3] target/iblock: Add WRITE_SAME w/ UNMAP=0 emulation support

2012-11-19 Thread Paolo Bonzini
Il 15/11/2012 21:01, Elliott, Robert (Server Storage) ha scritto: WRITE SAME always has a payload, regardless of the UNMAP bit value. For WRITE SAME with UNMAP=0, it's extremely important; that's how what to write is specified. For WRITE SAME with UNMAP=1, the device server is required to

Re: [PATCH 2/3] target: Add max_write_same_len device attribute

2012-11-16 Thread Paolo Bonzini
Il 15/11/2012 20:23, Nicholas A. Bellinger ha scritto: This patch adds a new max_write_same_len device attribute for use with WRITE_SAME w/ UNMAP=0 backend emulation. Also, update block limits VPD emulation code in spc_emulate_evpd_b0() to set the default MAXIMUM WRITE SAME

[PATCH v3 0/2] add per-device sysfs knob to enable unrestricted, unprivileged SG_IO

2012-11-13 Thread Paolo Bonzini
was NACKed). Ok for 3.8? v2-v3: change bitmap filter to boolean Paolo Bonzini (2): sg_io: pass request_queue to blk_verify_command sg_io: introduce unpriv_sgio queue flag block/blk-sysfs.c | 32 block/bsg.c|2 +- block/scsi_ioctl.c |9

[PATCH v3 2/2] sg_io: introduce unpriv_sgio queue flag

2012-11-13 Thread Paolo Bonzini
: Ric Wheeler rwhee...@redhat.com Cc: Tejun Heo t...@kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v2-v3: change bitmap filter to boolean block/blk-sysfs.c | 32 block/scsi_ioctl.c |2 +- include/linux/blkdev.h |3 +++ 3

[PATCH v3 1/2] sg_io: pass request_queue to blk_verify_command

2012-11-13 Thread Paolo Bonzini
...@redhat.com Cc: Tejun Heo t...@kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v2-v3: separated from block: add back queue-private command filter block/bsg.c|2 +- block/scsi_ioctl.c |7 --- drivers/scsi/sg.c |3 ++- include/linux/blkdev.h

Re: [PATCH] Use SCSI read/write(16) with 2TB drives

2012-11-13 Thread Paolo Bonzini
Il 14/11/2012 01:54, Jason J. Herne ha scritto: blk_queue_physical_block_size(sdp-request_queue, sdkp-physical_block_size); sdkp-device-sector_size = sector_size; + + /* Use read/write(16) for 2TB disks */ + sdp-use_16_for_rw =

Re: [PATCH] USB enclosures seem to require read(16) with 2TB drives

2012-11-12 Thread Paolo Bonzini
Il 12/11/2012 12:33, James Bottomley ha scritto: On Fri, 2012-11-09 at 11:08 -0500, Jason J. Herne wrote: diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index 13b8bcd..6ff785e 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c @@

Re: [PATCH] USB enclosures seem to require read(16) with 2TB drives

2012-11-12 Thread Paolo Bonzini
Il 12/11/2012 16:10, James Bottomley ha scritto: Actually it only turns it on for large capacity drives, as said in the comment. sdp-force_read_16 only matters for 2TB drives: If you follow the discussion, we'll need to turn it on for some drives regardless of size. Even if the two

Re: [PATCH] virtio-scsi: Fix incorrect lock release order in virtscsi_kick_cmd

2012-11-09 Thread Paolo Bonzini
tgt-tgt_lock while invoking the calls to virtio_ring.c:virtqueue_add_buf() and friends. This bug was originally introduced in v3.5-rc7 code with: commit 2bd37f0fde99cbf8b78fb55f1128e8c3a63cf1da Author: Paolo Bonzini pbonz...@redhat.com Date: Wed Jun 13 16:56:34 2012 +0200 [SCSI

Re: [PATCH] virtio_scsi: fix memory leak on full queue condition.

2012-11-09 Thread Paolo Bonzini
: return ret; Acked-by: Paolo Bonzini pbonz...@redhat.com Paolo -- To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] virtio-scsi: Fix incorrect lock release order in virtscsi_kick_cmd

2012-11-09 Thread Paolo Bonzini
Il 09/11/2012 20:31, Nicholas A. Bellinger ha scritto: That's done on purpose. After you do virtqueue_add_buf, you don't need the sg list anymore, nor the lock that protects it. The cover letter is at https://lkml.org/lkml/2012/6/13/295 and had this text: This series reorganizes the

Re: [PATCH 0/5] virtio-scsi: create a separate workqueue

2012-11-07 Thread Paolo Bonzini
variable gfp_mask virtio-scsi: use pr_err instead of printk virtio-scsi: create a separate work queue for virtio-scsi virtio-scsi: tidy up the goto label in init() Cc: James E.J. Bottomley jbottom...@parallels.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: Rusty Russell ru

Re: [PATCH v2 0/3] block: add queue-private command filter, editable via sysfs

2012-10-19 Thread Paolo Bonzini
In one use case, the administrator then needs the ability to configure devices easily, for example to be much more restrictive on non-MMC devices. It must be done with the same tools it uses for other aspects of the policy---which will be a combination of DAC (Unix permissions and ACLs)

Re: [PATCH v2 0/3] block: add queue-private command filter, editable via sysfs

2012-10-04 Thread Paolo Bonzini
Il 25/09/2012 17:30, Paolo Bonzini ha scritto: The set of use cases for SG_IO is quite variable that no single filter can accomodate all of them. The current filter is tailored very much to CD burning, and includes many MMC-specific commands that may have other meanings in different standards

Re: [PATCH 0/2] virtio-scsi fixes for 3.6

2012-10-02 Thread Paolo Bonzini
Il 02/10/2012 10:18, James Bottomley ha scritto: On Mon, 2012-10-01 at 15:11 +0200, Paolo Bonzini wrote: Il 26/07/2012 15:28, Paolo Bonzini ha scritto: James, patch 1 fixes scanning of LUNs whose number is greater than 255. QEMU passes a max_lun of 16383 (because it uses SAM numbering

[PATCH 0/3] virtio-scsi updates for 3.7

2012-10-02 Thread Paolo Bonzini
James, here is a resend of the three pending patches for virtio-scsi, with the bugfix first. Thanks, Paolo Paolo Bonzini (2): virtio-scsi: fix LUNs greater than 255 virtio-scsi: support online resizing of disks Richard W.M. Jones (1): virtio-scsi: initialize scatterlist structure

[PATCH 1/3] virtio-scsi: initialize scatterlist structure

2012-10-02 Thread Paolo Bonzini
From: Richard W.M. Jones rjo...@redhat.com The sg struct is used without being initialized, which breaks when CONFIG_DEBUG_SG is enabled. Cc: sta...@vger.kernel.org Signed-off-by: Richard W.M. Jones rjo...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi

<    1   2   3   4   >