[PATCH 1/1] scsi: snic: fix improper return value

2016-12-03 Thread Pan Bian
From: Pan Bian When the calls to mempool_create_slab_pool() return unexpected values, the value of return variable ret is 0. 0 means no error. Thus, the caller of fnic_probe() cannot detect the error, and may be misled. This patch fixes the bug, assigning "-ENOMEM" to ret before calling mempool_c

[PATCH 1/1] scsi: fnic: fix improper return value

2016-12-03 Thread Pan Bian
From: Pan Bian When the calls to mempool_create_slab_pool() return unexpected values, the value of return variable err is 0. 0 means no error. Thus, the caller of fnic_probe() cannot detect the error, and may be misled. This patch fixes the bug, assigning "-ENOMEM" to err before calling mempool_c

[PATCH 1/2] scsi: be2iscsi: set errno on error path

2016-12-03 Thread Pan Bian
From: Pan Bian Variable ret is reset in the loop, and its value will be 0 during the second and after repeat of the loop. If pci_alloc_consistent() returns a NULL pointer then, it will leaves with return value 0. 0 means no error, which is contrary to the fact. This patches fixes the bug, explici

[PATCH 1/1] scsi: 3w-sas: set errno on failures

2016-12-03 Thread Pan Bian
From: Pan Bian On some error paths (e.g. pci_iomap() returns a NULL pointer), the value of return variable retval is 0. 0 means no error. This patch fixes the bug, set retval with negative errno on error paths. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=189001 Signed-off-by: Pan Bian

[PATCH 2/2] scsi: be2iscsi: set errno on error path

2016-12-03 Thread Pan Bian
From: Pan Bian Variable ret is reset in the loop, and its value will be 0 during the second and after repeat of the loop. If pci_alloc_consistent() returns a NULL pointer then, it will leaves with return value 0. 0 means no error, which is contrary to the fact. This patches fixes the bug, explici

Re: scsi: use-after-free in bio_copy_from_iter

2016-12-03 Thread Johannes Thumshirn
On Sat, Dec 03, 2016 at 04:22:39PM +0100, Dmitry Vyukov wrote: > On Sat, Dec 3, 2016 at 11:38 AM, Johannes Thumshirn > wrote: > > On Fri, Dec 02, 2016 at 05:50:39PM +0100, Dmitry Vyukov wrote: > >> On Fri, Nov 25, 2016 at 8:08 PM, Dmitry Vyukov wrote: [...] Hi Dmitry, > > Thanks for looking

Re: scsi: use-after-free in bio_copy_from_iter

2016-12-03 Thread Dmitry Vyukov
On Sat, Dec 3, 2016 at 11:38 AM, Johannes Thumshirn wrote: > On Fri, Dec 02, 2016 at 05:50:39PM +0100, Dmitry Vyukov wrote: >> On Fri, Nov 25, 2016 at 8:08 PM, Dmitry Vyukov wrote: > > [...] > >> >> +David did some debugging of a similar case. His 0x400 at location >> 0x2000efdc refers to 0x

[PATCH 1/1] scsi: 32-9xxx: fix improper return value on errors

2016-12-03 Thread Pan Bian
From: Pan Bian In function twa_probe(), returns the value of variable retval on error paths. However, on some error paths, retval is not set to negative errnos, and its value will keep 0. This patch fixes them. Signed-off-by: Pan Bian --- drivers/scsi/3w-9xxx.c | 6 +- 1 file changed, 5 in

[PATCH 1/1] scsi: csiostor: fix improper reference to variable

2016-12-03 Thread Pan Bian
From: Pan Bian In function csio_config_device_caps(), returns the value of variable rv on error paths. However, when validating device capabilities, its value is reset, and will be 0 on the following error paths. 0 means no error in this context. It may be better to use variable retval to receive

Re: scsi: use-after-free in bio_copy_from_iter

2016-12-03 Thread Johannes Thumshirn
On Fri, Dec 02, 2016 at 05:50:39PM +0100, Dmitry Vyukov wrote: > On Fri, Nov 25, 2016 at 8:08 PM, Dmitry Vyukov wrote: [...] > > +David did some debugging of a similar case. His 0x400 at location > 0x2000efdc refers to 0x at 0x20012fdc in the provided reproducer: > NONFAILING(*(uint32_t

[PATCH 1/1] scsi: csiostor: fix improper return value

2016-12-03 Thread Pan Bian
Function csio_hw_flash_erase_sectors() will always return 0, even on failures. Thus, its callers will not detect the errors, and may produce unexpected behavior. To avoid bugs, this patch replaces "return 0;" with "return ret;". Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188681 Signed-

Re: [PATCHv3] hpsa: fallback to use legacy REPORT PHYS command

2016-12-03 Thread Hannes Reinecke
On 12/03/2016 01:36 AM, Don Brace wrote: -Original Message- From: Hannes Reinecke [mailto:h...@suse.de] Sent: Friday, December 02, 2016 4:36 AM To: Martin K. Petersen Cc: Christoph Hellwig; James Bottomley; Don Brace; linux- s...@vger.kernel.org; Hannes Reinecke; Hannes Reinecke Subject: