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 Tejun Heo
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 the device to the user anyway. Let's either

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 the

[PATCH] scsi: use platform_{get,set}_drvdata()

2013-05-23 Thread Jingoo Han
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Also, unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL

RE: [PATCH V1 00/17] Update the driver version to 3.2.21.1

2013-05-23 Thread Vijay Mohan Guvva
-Original Message- From: Vijay Mohan Guvva Sent: Monday, May 13, 2013 3:03 PM To: linux-scsi@vger.kernel.org Cc: jbottom...@parallels.com; Adapter Linux Open SRC Team; Vijay Mohan Guvva Subject: [PATCH V1 00/17] Update the driver version to 3.2.21.1 Hi James, Re-submitting the

RE: [PATCH 1/1] bfa: Fixes for 0-terminated strncpy and possible null pointer dereference

2013-05-23 Thread Vijay Mohan Guvva
-Original Message- From: linux-scsi-ow...@vger.kernel.org [mailto:linux-scsi- ow...@vger.kernel.org] On Behalf Of Jakob Normark Sent: Thursday, May 16, 2013 1:12 AM To: Anil Gurumurthy; Vijay Mohan Guvva; James E.J. Bottomley Cc: linux-scsi@vger.kernel.org;

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

2013-05-23 Thread Paolo Bonzini
Store the filters in a 256-entry array, and pick an appropriate filter for SCSI devices. Apart from SCSI disks, SG_IO is supported for CCISS, ide-floppy and virtio-blk devices; TYPE_DISK (which is zero, i.e. the default) is more appropriate for these devices than TYPE_ROM. However, all lists are

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

2013-05-23 Thread Paolo Bonzini
Some SCSI commands can be sent to disks via SG_IO even by unprivileged users. Unfortunately, some opcodes overlap across SCSI device classes and have different meanings for different classes. Four of them can be used for read-only file descriptors on MMC, but should be limited to descriptors

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

2013-05-23 Thread Paolo Bonzini
After this patch, a few commands are forbidden for devices of type other than TYPE_ROM, where they are reserved, vendor-specific. This avoids that future version of the standards introduce unwanted conficts. One command (READ CAPACITY) was listed twice in the old table (once as READ_CAPACITY,

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

2013-05-23 Thread Paolo Bonzini
Start cleaning up the table, moving out of the way four rare obsolete device types: printers, communication devices (network cards), and processor devices. This patch is included mostly for tidiness, so that flags for obsolete device types do not clutter the other entries. However, it adds two

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

2013-05-23 Thread Paolo Bonzini
Besides CD-ROMs, three more device types are interesting for SG_IO: media changers, tapes and of course disks. Starting with this patch, we will whitelist a few more commands for these devices. For media changers, enable INITIALIZE ELEMENT STATUS and REQUEST VOLUME ELEMENT ADDRESS. A few

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

2013-05-23 Thread Paolo Bonzini
Tapes have no problematic overlap, but quite a few commands are missing that are useful when operating tapes with /dev/sg. This patch adds commands from the SSC standards to the list. I added everything because the current whitelist is totally inapplicable to those devices; the command set is

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

2013-05-23 Thread Paolo Bonzini
This splits entries for SBC commands that conflict with MMC, and adds missing commands to the table from SBC and related standards. Only commands that affect the medium are added: - I added ATA PASS-THROUGH(16) because ATA PASS-THROUGH(12) is present; using the (16) version is preferrable because

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

2013-05-23 Thread Paolo Bonzini
Three MMC commands were never included: PLAY AUDIO(12), SERVICE ACTION IN(12), MECHANISM STATUS. Add MECHANISM STATUS, the only one that has not been obsoleted in recent versions of the standard. QEMU implements it, so it is reasonable to assume that someone is using it. Cc: James E.J.

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

2013-05-23 Thread Paolo Bonzini
Some SCSI commands were special cased at the end of the table because they overlapped across SCSI device classes, with different meanings for different classes. Instead of hacking the bits manually, use separate entries in the table. The 0xA4 opcode is blocked for non-MMC devices, even when open

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

2013-05-23 Thread Paolo Bonzini
To prepare for the next patches, abstract setting of an entry in the command filter behind a macro. The next patch will change the implementation of the macro. Cc: sta...@gnu.org Cc: James E.J. Bottomley jbottom...@parallels.com Cc: linux-scsi@vger.kernel.org Cc: Jens Axboe ax...@kernel.dk

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

2013-05-23 Thread Paolo Bonzini
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 to persistent reservations, trim/discard, or

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

2013-05-23 Thread Paolo Bonzini
Adjust the blk_verify_command function to let it look at per-queue data. This will be done in the next patch. Acked-by: Tejun Heo t...@kernel.org Cc: sta...@gnu.org Cc: FUJITA Tomonori fujita.tomon...@lab.ntt.co.jp Cc: Doug Gilbert dgilb...@interlog.com Cc: James E.J. Bottomley

RE: [PATCH V1 1/7] Drivers: hv: vmbus: Implement multi-channel support

2013-05-23 Thread KY Srinivasan
-Original Message- From: Greg KH [mailto:gre...@linuxfoundation.org] Sent: Thursday, May 16, 2013 10:01 AM To: KY Srinivasan Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; oher...@suse.com; jbottom...@parallels.com; h...@infradead.org; linux- s...@vger.kernel.org;

SCSI error handling -- one error blocks the whole SCSI host

2013-05-23 Thread Roland Dreier
At LSF this year, we had a discussion about error handling and in particular the problem that SCSI midlayer error handling waits for the entire SCSI host (HBA) to quiesce before it starts to abort commands etc. James made the suggestion that FC should handle things the way SAS does, because SAS

re :SCSI error handling -- one error blocks the whole SCSI host

2013-05-23 Thread Jack Wang
James, am I understanding your suggestion properly? If so can you explain what you meant about the libsas code -- I see that it has its own strategy handler but as I said before we've already stopped every device attached to the HBA before we ever get there. To recapitulate the problem

[PATCH v4] block: handle pointer error from blk_get_request

2013-05-23 Thread Joe Lawrence
Hi Jens, A small fix to this patch to properly cleanup sg_scsi_ioctl buffer when blk_get_request fails (a return value check was introduced in patch version 1). Since this is change emanates out of the block layer, I'm assuming it should go through your tree, though I'm not sure which branch it

Re: [PATCH v4] block: handle pointer error from blk_get_request

2013-05-23 Thread Boaz Harrosh
On 23/05/13 23:09, Joe Lawrence wrote: Hi Jens, Subject: [PATCH v4] block: handle pointer error from blk_get_request The blk_get_request function may fail in low-memory conditions or during device removal (even if __GFP_WAIT is set). To distinguish between these errors, modify the

Re: [PATCH] block,scsi: verify return pointer from blk_get_request

2013-05-23 Thread James Bottomley
On Sun, 2013-03-17 at 16:44 -0600, Jens Axboe wrote: On Sun, Mar 17 2013, Joe Lawrence wrote: Hello James / Jiri / Jens, Stratus hit a NULL ptr deference bug when removing a USB CD-ROM while burning a DVD. The stack trace below was produced on a RHEL 6.4-GA kernel, however it looks

Re: [PATCH] block,scsi: verify return pointer from blk_get_request

2013-05-23 Thread Joe Lawrence
On Fri, 24 May 2013 00:40:11 +0400 James Bottomley james.bottom...@hansenpartnership.com wrote: Now that we see the size of the patch diff between fixing the bug and doing proper error returns, I'm really not convinced this should be done as a single bug fix patch. The modify all error returns

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 Tejun Heo
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 filtering (of any form really) has always been

[PATCH] scsi: megaraid: check kzalloc

2013-05-23 Thread Libo Chen
we should check kzalloc, avoid to hit oops Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/scsi/megaraid.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 846f475..195b095 100644 ---

Re: [PATCH] scsi: megaraid: check kzalloc

2013-05-23 Thread Santosh Y
On Fri, May 24, 2013 at 7:52 AM, Libo Chen clbchenlibo.c...@huawei.com wrote: we should check kzalloc, avoid to hit oops Signed-off-by: Libo Chen libo.c...@huawei.com --- drivers/scsi/megaraid.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git