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 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

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 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

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]; +} + +

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

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

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

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

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

2013-05-23 Thread Paolo Bonzini
Il 23/05/2013 00:17, Tejun Heo ha scritto: Then let's make it fit the use case better. I really can't see much point in crafting the cdb filter when you basically have to entrust the device to the user anyway. Let's either trust the user with the device or not. I'm very doubtful that the

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

2013-05-23 Thread Paolo Bonzini
Il 23/05/2013 11:02, Tejun Heo ha scritto: On Thu, May 23, 2013 at 09:45:42AM +0200, Paolo Bonzini wrote: Il 23/05/2013 00:17, Tejun Heo ha scritto: Then let's make it fit the use case better. I really can't see much point in crafting the cdb filter when you basically have to entrust

[PATCH v3 part1 3/4] sg_io: use different default filters for each device class

2013-05-23 Thread Paolo Bonzini
are still the same, so there is no semantic change in this patch. 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 | 14

[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

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

2013-05-24 Thread Paolo Bonzini
Il 24/05/2013 03:44, Tejun Heo ha scritto: On Thu, May 23, 2013 at 11:47:25AM +0200, Paolo Bonzini wrote: No no, I'm not talking about it not working for the users - it's just passing the commands, it of course works. I'm doubting about it being a worthy security isolation layer. cdb

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

2013-05-24 Thread Paolo Bonzini
Il 24/05/2013 09:36, James Bottomley ha scritto: On Thu, 2013-05-23 at 15:58 +0200, Paolo Bonzini wrote: Adjust the blk_verify_command function to let it look at per-queue data. This will be done in the next patch. This is not a bug fix. This is an enabler for your complex and to my mind

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

2013-05-24 Thread Paolo Bonzini
Il 24/05/2013 09:50, James Bottomley ha scritto: On Fri, 2013-05-24 at 09:43 +0200, Paolo Bonzini wrote: Il 24/05/2013 09:36, James Bottomley ha scritto: On Thu, 2013-05-23 at 15:58 +0200, Paolo Bonzini wrote: Adjust the blk_verify_command function to let it look at per-queue data

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

2013-05-24 Thread Paolo Bonzini
Il 24/05/2013 10:02, Tejun Heo ha scritto: On Fri, May 24, 2013 at 4:13 PM, Paolo Bonzini pbonz...@redhat.com wrote: The same filtering table being applied to different classes of hardware is a software bug, but my point is that the practive essentially entrusts non-insignificant part

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

2013-05-24 Thread Paolo Bonzini
Il 24/05/2013 10:03, James Bottomley ha scritto: Does anyone in the real world actually care about this bug? Yes, or I would move on and not waste so much time on this. Fine, so produce a simple fix for this bug which we can discuss that's not tied to this feature.

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

2013-05-24 Thread Paolo Bonzini
Il 24/05/2013 11:07, Tejun Heo ha scritto: On Fri, May 24, 2013 at 5:31 PM, Paolo Bonzini pbonz...@redhat.com wrote: I agree intuition may not count, and it's perfectly possible that firmware writers forgot a break; or put the wrong location in a jump table, so that unimplemented commands give

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

2013-05-24 Thread Paolo Bonzini
Il 24/05/2013 10:32, Paolo Bonzini ha scritto: Il 24/05/2013 10:03, James Bottomley ha scritto: Does anyone in the real world actually care about this bug? Yes, or I would move on and not waste so much time on this. Fine, so produce a simple fix for this bug which we can discuss that's

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

2013-05-25 Thread Paolo Bonzini
Il 25/05/2013 06:14, James Bottomley ha scritto: On Fri, 2013-05-24 at 10:32 +0200, Paolo Bonzini wrote: Il 24/05/2013 10:03, James Bottomley ha scritto: Does anyone in the real world actually care about this bug? Yes, or I would move on and not waste so much time on this. Fine, so produce

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

2013-05-25 Thread Paolo Bonzini
Il 25/05/2013 07:27, Christoph Hellwig ha scritto: On Fri, May 24, 2013 at 09:35:02PM -0700, James Bottomley wrote: I'll go along with this. I'm also wondering what the problem would be if we just allowed all commands on either CAP_SYS_RAWIO or opening the device for write, so we just defer

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

2013-05-25 Thread Paolo Bonzini
Il 25/05/2013 09:11, Christoph Hellwig ha scritto: Linus wanted to keep that for CAP_SYS_RAWIO. We found two uses of SG_IO on partitions: zfs-fuse used SYNCHRONIZE CACHE; some proprietary driver used TEST UNIT READY. Really, the solution is to make the bitmaps configurable in

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

2013-05-25 Thread Paolo Bonzini
Il 25/05/2013 10:37, Tejun Heo ha scritto: Hey, James. On Fri, May 24, 2013 at 09:35:02PM -0700, James Bottomley wrote: Well, I'd actually much prefer disabling CDB whitelisting for all !MMC devices if at all possible. I'll go along with this. I'm also wondering what the problem would be

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

2013-05-25 Thread Paolo Bonzini
Il 25/05/2013 14:48, Tejun Heo ha scritto: * Merge the patch to give out SG_IO access along with write access, so the use cases which want to give out SG_IO access can do so explicitly and be fully responsible for the device. This makes sense to me. If one wants to be allowed to

[RFC PATCH 3/4] block: add back command filter modification via sysfs

2013-05-27 Thread Paolo Bonzini
anyway never really enabled, the different API is not a problem. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- Documentation/block/queue-sysfs.txt | 16 ++ block/Kconfig | 10 block/blk-sysfs.c | 41

[RFC PATCH 1/4] block: add back queue-private command filter

2013-05-27 Thread Paolo Bonzini
filtering is desired. This is a partial (and massaged) revert of commit 018e044 (block: get rid of queue-private command filter, 2009-06-26). Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/blk-sysfs.c | 2 ++ block/bsg.c| 2 +- block

[RFC PATCH 2/4] scsi: create an all-zero filter for scanners

2013-05-27 Thread Paolo Bonzini
Using /dev/sg for scanners is blocked from unprivileged users. Reimplement this using customizable command filters, so that the sysfs knobs will work in this case too. Cc: linux-scsi@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/scsi_scan.c | 8

[RFC PATCH 0/4] SG_IO filtering via sysfs and minimal whitelist

2013-05-27 Thread Paolo Bonzini
. Paolo Paolo Bonzini (4): block: add back queue-private command filter scsi: create an all-zero filter for scanners block: add back command filter modification via sysfs scsi: lock out SG_IO by default to unprivileged users Documentation/block/queue-sysfs.txt | 16 + block/Kconfig

[RFC PATCH 4/4] scsi: lock out SG_IO by default to unprivileged users

2013-05-27 Thread Paolo Bonzini
be a regression for those who are using Unix permissions, security modules or the device cgroup to confine programs. A meaningful whitelist can then be set by udev, for example. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- This is not yet usable, because sg devices do not have a link

Re: [PATCH 4/9] virtio_scsi: Enable new EH timeout handler

2013-06-12 Thread Paolo Bonzini
, .eh_abort_handler = virtscsi_abort, .eh_device_reset_handler = virtscsi_device_reset, + .eh_timed_out = virtscsi_timedout, .can_queue = 1024, .dma_boundary = UINT_MAX, Acked-by: Paolo Bonzini pbonz...@redhat.com -- To unsubscribe from this list: send the line

Re: [PATCH 5/9] virtio-scsi: Implement TMF timeout

2013-06-12 Thread Paolo Bonzini
Il 10/06/2013 03:40, Hannes Reinecke ha scritto: Any TMF might be take longer as expected, or not return at all. So we need to use 'wait_for_completion_timeout' when sending a TMF to protect against these cases. Cc: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Hannes Reinecke h

Re: [RFC PATCH 0/4] SG_IO filtering via sysfs and minimal whitelist

2013-06-25 Thread Paolo Bonzini
Il 27/05/2013 15:50, Paolo Bonzini ha scritto: We've been running in circles for nine months now. Let's restart from the maintainer's suggestion, which was probably dismissed too quickly. This is still not a complete solution, because /dev/sgN does not have access to its queue object

Re: [RFC PATCH 0/4] SG_IO filtering via sysfs and minimal whitelist

2013-07-05 Thread Paolo Bonzini
Il 25/06/2013 23:19, Paolo Bonzini ha scritto: Il 27/05/2013 15:50, Paolo Bonzini ha scritto: We've been running in circles for nine months now. Let's restart from the maintainer's suggestion, which was probably dismissed too quickly. This is still not a complete solution, because /dev/sgN

Re: [PATCH] virtio-scsi: Fix virtqueue affinity setup

2013-08-01 Thread Paolo Bonzini
vscsi-num_queues counts the number of request virtqueue which does not include the control and event virtqueue. It is wrong to subtract VIRTIO_SCSI_VQ_BASE from vscsi-num_queues. Reviewed-by: Paolo Bonzini pbonz...@redhat.com This patch fixes the following panic. (qemu) device_del scsi0

Re: [PATCH 5/6] [SCSI] Look up and store NAA if VPD page 0x83 is present

2014-06-02 Thread Paolo Bonzini
Il 29/05/2014 05:52, Martin K. Petersen ha scritto: + sdev_printk(KERN_ERR, sdev, + %s: VPD page 0x83 NAA descriptor not found\n, __func__); + + return; I suspect this error will be relatively common. libata for example has if (ata_id_has_wwn(args-id)) {

Re: [PATCH 5/6] [SCSI] Look up and store NAA if VPD page 0x83 is present

2014-06-03 Thread Paolo Bonzini
Il 03/06/2014 03:00, Martin K. Petersen ha scritto: Paolo == Paolo Bonzini pbonz...@redhat.com writes: + sdev_printk(KERN_ERR, sdev, + %s: VPD page 0x83 NAA descriptor not found\n, __func__); + + return; Paolo I suspect this error will be relatively common. You're right. But we would like

[PATCH 5/6] virtio-scsi: fix various bad behavior on aborted requests

2014-06-03 Thread Paolo Bonzini
or oopses. Cc: sta...@vger.kernel.org Cc: Ulrich Obergfell uober...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index

[PATCH 6/6] virtio-scsi: Implement change_queue_depth for virtscsi targets

2014-06-03 Thread Paolo Bonzini
up to the device maximum when the BUSY condition has resolved. Signed-off-by: Venkatesh Srinivas venkate...@google.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 33 + 1 file changed, 33 insertions(+) diff --git a/drivers/scsi

[PATCH 4/6] scsi_error: fix invalid setting of host byte

2014-06-03 Thread Paolo Bonzini
will corrupt the result field and initiate an unwanted command retry. Fix this by using set_host_byte instead, following the model of commit 2082ebc45af9c9c648383b8cde0dc1948eadbf31. Cc: sta...@vger.kernel.org Signed-off-by: Ulrich Obergfell uober...@redhat.com Signed-off-by: Paolo Bonzini pbonz

[PATCH 1/6] virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends()

2014-06-03 Thread Paolo Bonzini
req_vq is read from scsi-req_vqs[vq-index - VIRTIO_SCSI_VQ_BASE] instead of tgt-req_vq, so remove the unnecessary barrier. Also remove related comment about the barrier. Cc: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Ming Lei tom.leim...@gmail.com Signed-off-by: Paolo Bonzini pbonz

[PATCH resend 0/6] virtio-scsi patches for 3.16 + a midlayer one-liner

2014-06-03 Thread Paolo Bonzini
Ming Lei (2): virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends() virtio-scsi: replace target spinlock with seqcount Paolo Bonzini (2): virtio-scsi: avoid cancelling uninitialized work items virtio-scsi: fix various bad behavior on aborted requests Ulrich Obergfell (1

[PATCH v2 0/6] virtio-scsi patches for 3.16 + midlayer fix

2014-06-04 Thread Paolo Bonzini
): virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends() virtio-scsi: replace target spinlock with seqcount Paolo Bonzini (2): virtio-scsi: avoid cancelling uninitialized work items virtio-scsi: fix various bad behavior on aborted requests Ulrich Obergfell (1): scsi_error: fix

[PATCH v2 4/6] scsi_error: fix invalid setting of host byte

2014-06-04 Thread Paolo Bonzini
comments. - Paolo] Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: fix all occurrences [Bart] drivers/scsi/scsi_error.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index f17aa7aa7879

[PATCH v2 6/6] virtio-scsi: Implement change_queue_depth for virtscsi targets

2014-06-04 Thread Paolo Bonzini
up to the device maximum when the BUSY condition has resolved. Signed-off-by: Venkatesh Srinivas venkate...@google.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 33 + 1 file changed, 33 insertions(+) diff --git a/drivers/scsi

[PATCH v2 5/6] virtio-scsi: fix various bad behavior on aborted requests

2014-06-04 Thread Paolo Bonzini
or oopses. Cc: sta...@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index d66c4ee2c774..fda9fb35 100644

[PATCH v2 3/6] virtio-scsi: avoid cancelling uninitialized work items

2014-06-04 Thread Paolo Bonzini
Calling the workqueue interface on uninitialized work items isn't a good idea even if they're zeroed. It's not failing catastrophically only through happy accidents. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 4 +++- 1 file changed, 3 insertions(+), 1

[PATCH v2 1/6] virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends()

2014-06-04 Thread Paolo Bonzini
req_vq is read from scsi-req_vqs[vq-index - VIRTIO_SCSI_VQ_BASE] instead of tgt-req_vq, so remove the unnecessary barrier. Also remove related comment about the barrier. Cc: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Ming Lei tom.leim...@gmail.com Signed-off-by: Paolo Bonzini pbonz

[PATCH v2 2/6] virtio-scsi: replace target spinlock with seqcount

2014-06-04 Thread Paolo Bonzini
@canonical.com [Add initialization in virtscsi_target_alloc. - Paolo] Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 42 +- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi

Re: [PATCH v2 0/6] virtio-scsi patches for 3.16 + midlayer fix

2014-06-04 Thread Paolo Bonzini
Il 04/06/2014 13:21, Bart Van Assche ha scritto: Thanks for the quick respin. However, since you are mentioning that in v2 all occurrences of scmd-result |= DID_TIME_OUT 16 have been addressed, this made me wonder whether you had noticed the following code in scsi_decide_disposition() ?

[PATCH v3 6/6] virtio-scsi: Implement change_queue_depth for virtscsi targets

2014-06-04 Thread Paolo Bonzini
up to the device maximum when the BUSY condition has resolved. Signed-off-by: Venkatesh Srinivas venkate...@google.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 33 + 1 file changed, 33 insertions(+) diff --git a/drivers/scsi

[PATCH v3 5/6] virtio-scsi: fix various bad behavior on aborted requests

2014-06-04 Thread Paolo Bonzini
or oopses. Cc: sta...@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index d66c4ee2c774..fda9fb35 100644

[PATCH v3 2/6] virtio-scsi: replace target spinlock with seqcount

2014-06-04 Thread Paolo Bonzini
@canonical.com [Add initialization in virtscsi_target_alloc. - Paolo] Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 42 +- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi

[PATCH v3 4/6] scsi_error: fix invalid setting of host byte

2014-06-04 Thread Paolo Bonzini
comments. - Paolo] Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: fix all occurrences [Bart] except one v2-v3: really fix all occurrences [Bart] drivers/scsi/scsi_error.c | 6 +++--- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi

[PATCH v3 3/6] virtio-scsi: avoid cancelling uninitialized work items

2014-06-04 Thread Paolo Bonzini
Calling the workqueue interface on uninitialized work items isn't a good idea even if they're zeroed. It's not failing catastrophically only through happy accidents. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 4 +++- 1 file changed, 3 insertions(+), 1

[PATCH v3 1/6] virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends()

2014-06-04 Thread Paolo Bonzini
req_vq is read from scsi-req_vqs[vq-index - VIRTIO_SCSI_VQ_BASE] instead of tgt-req_vq, so remove the unnecessary barrier. Also remove related comment about the barrier. Cc: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Ming Lei tom.leim...@gmail.com Signed-off-by: Paolo Bonzini pbonz

[PATCH v3 0/6] virtio-scsi patches for 3.16 + midlayer fix

2014-06-04 Thread Paolo Bonzini
fix all occurrences in patch 4 Ming Lei (2): virtio_scsi: remove ACCESS_ONCE() and smp_read_barrier_depends() virtio-scsi: replace target spinlock with seqcount Paolo Bonzini (2): virtio-scsi: avoid cancelling uninitialized work items virtio-scsi: fix various bad behavior on aborted

Re: [PATCH v3 5/6] virtio-scsi: fix various bad behavior on aborted requests

2014-06-04 Thread Paolo Bonzini
Il 04/06/2014 19:29, Venkatesh Srinivas ha scritto: Do you really want to poll the request VQs for completions if the TMF was rejected? I wasn't sure, but bugs in this path are hard enough that I preferred the safer patch. TMF ABORT may return FUNCTION REJECTED if the command to abort

Re: [PATCH] scsi: ibmvscsi: protect abort handler from done-scmd in flight

2014-06-05 Thread Paolo Bonzini
Il 05/06/2014 08:16, Liu Ping Fan ha scritto: Take the following scene in guest: seqA: scsi_done() - gapX (before taking REQ_ATOM_COMPLETE) seqB: scmd_eh_abort_handler()- ...- ibmvscsi_eh_abort_handler()- ...-scsi_put_command(scmd) If seqA is scheduled at gapX, and seqB reclaims scmd.

Re: [PATCH-v2 0/6] vhost/scsi: Add T10 PI SGL passthrough support

2014-06-09 Thread Paolo Bonzini
Il 08/06/2014 18:05, Michael S. Tsirkin ha scritto: OK, finally went over this, looks good to me: Acked-by: Michael S. Tsirkin m...@redhat.com However, we really should stop making more changes before fixing ANY_LAYOUT in this driver. virtio 1.0 should be out soon and that makes ANY_LAYOUT a

Re: [PATCH-v2 0/6] vhost/scsi: Add T10 PI SGL passthrough support

2014-06-10 Thread Paolo Bonzini
Il 10/06/2014 09:07, Nicholas A. Bellinger ha scritto: OK, finally went over this, looks good to me: Acked-by: Michael S. Tsirkin m...@redhat.com However, we really should stop making more changes before fixing ANY_LAYOUT in this driver. virtio 1.0 should be out soon and that makes

Re: [PATCH v1 3/3] TARGET/sbc,loopback: Adjust command data length in case pi exists on the wire

2014-06-10 Thread Paolo Bonzini
Il 10/06/2014 10:04, Nicholas A. Bellinger ha scritto: That said, there is one other small qla2xxx change to enable per-session PI that is currently missing in Quinn's patch in scsi/for-next code. Sooo, I'll go ahead and include Sagi's patches with the vhost-scsi change below if there are no

Re: [PATCH 1/5] ibmvstgt: remove

2014-07-01 Thread Paolo Bonzini
Il 24/06/2014 16:28, Christoph Hellwig ha scritto: Adding Paul and Nathan to cc here. I'm pretty sure the backend for ibmvscsi in KVM was all done in qemu and there is no dependency on ibmvstgt. FWIW the ibmvscsi backend is indeed entirely in userspace (hw/scsi/spapr_vscsi.c in the QEMU

Re: [PATCH 5/5] scsi: remove various exports that were only used by scsi_tgt

2014-07-04 Thread Paolo Bonzini
, struct device *dev) { Reviewed-by: Paolo Bonzini pbonz...@redhat.com -- 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: tgt infrastructure removal

2014-07-04 Thread Paolo Bonzini
? Not that there's much to review there. :) Reviewed-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

[PATCH 0/2] virtio-scsi queue for 3.17

2014-07-06 Thread Paolo Bonzini
Christoph asked me to rebase the two virtio-scsi patches from http://thread.gmane.org/gmane.linux.kernel/1717796 that do not apply anymore, patch 2 and 6. These are on top of his drivers-for-3.16 branch, more precisely commit 8faeb529b2da (virtio-scsi: fix various bad behavior on aborted

[PATCH 1/2] virtio-scsi: replace target spinlock with seqcount

2014-07-06 Thread Paolo Bonzini
@canonical.com [Add initialization in virtscsi_target_alloc. - Paolo] Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- drivers/scsi/virtio_scsi.c | 42 +- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi

Re: [PATCH] virtio_scsi: check on resp-sense_len instead of 'sense_buffer'

2014-07-18 Thread Paolo Bonzini
Il 18/07/2014 16:57, Ming Lei ha scritto: - if (sc-sense_buffer) { + if (resp-sense_len) { In the (unlikely) case that sc-sense_buffer == NULL, you'd pass a NULL to memcpy. If you want, you can change this if to if (sc-sense_buffer resp-sense_len) but frankly it seems like

Re: Debugging scsi abort handling ?

2014-08-25 Thread Paolo Bonzini
Il 23/08/2014 16:52, Hans de Goede ha scritto: Hi All, Now that the UAS driver is no longer marked as CONFIG_BROKEN, I'm getting quite a few bug reports about issues with UAS drives. One if the issues is that there might be a number of bugs in the abort handling path, as I don't think

Re: Debugging scsi abort handling ?

2014-08-25 Thread Paolo Bonzini
Il 25/08/2014 12:28, Bart Van Assche ha scritto: From SPC-4: 7.5.8 Control mode page [ ... ] A task aborted status (TAS) bit set to zero specifies that aborted commands shall be terminated by the device server without any response to the application client. A TAS bit set to one specifies

  1   2   3   4   >