Re: [PATCH 2/3] scsi: megaraid_sas: check user-provided offsets

2021-01-04 Thread Arnd Bergmann
On Mon, Jan 4, 2021 at 6:48 PM Phil Oester wrote: > > On Sun, Jan 03, 2021 at 05:26:29PM +0100, Arnd Bergmann wrote: > > Thank you for the report and bisecting the issue, and sorry this broke > > your system! > > > > Fortunately, the patch is fairly small, so there are only a limited number > >

Re: [PATCH 2/3] scsi: megaraid_sas: check user-provided offsets

2021-01-04 Thread Phil Oester
On Sun, Jan 03, 2021 at 05:26:29PM +0100, Arnd Bergmann wrote: > Thank you for the report and bisecting the issue, and sorry this broke > your system! > > Fortunately, the patch is fairly small, so there are only a limited number > of things that could go wrong. I haven't tried to analyze that

Re: [PATCH 2/3] scsi: megaraid_sas: check user-provided offsets

2021-01-03 Thread James Bottomley
On Sun, 2021-01-03 at 19:49 +0100, Arnd Bergmann wrote: > On Sun, Jan 3, 2021 at 6:00 PM James Bottomley > wrote: > > On Sun, 2021-01-03 at 17:26 +0100, Arnd Bergmann wrote: > > [...] > > > @@ -8209,7 +8208,7 @@ megasas_mgmt_fw_ioctl(struct > > > megasas_instance > > > *instance, > > >

Re: [PATCH 2/3] scsi: megaraid_sas: check user-provided offsets

2021-01-03 Thread Arnd Bergmann
On Sun, Jan 3, 2021 at 6:00 PM James Bottomley wrote: > On Sun, 2021-01-03 at 17:26 +0100, Arnd Bergmann wrote: > [...] > > @@ -8209,7 +8208,7 @@ megasas_mgmt_fw_ioctl(struct megasas_instance > > *instance, > > if (instance->consistent_mask_64bit) > >

Re: [PATCH 2/3] scsi: megaraid_sas: check user-provided offsets

2021-01-03 Thread James Bottomley
On Sun, 2021-01-03 at 17:26 +0100, Arnd Bergmann wrote: [...] > @@ -8209,7 +8208,7 @@ megasas_mgmt_fw_ioctl(struct megasas_instance > *instance, > if (instance->consistent_mask_64bit) > put_unaligned_le64(sense_handle, sense_ptr); > else > -

Re: [PATCH 2/3] scsi: megaraid_sas: check user-provided offsets

2021-01-03 Thread Arnd Bergmann
On Thu, Dec 31, 2020 at 1:15 AM Phil Oester wrote: > > On Tue, Sep 08, 2020 at 11:36:22PM +0200, Arnd Bergmann wrote: > > It sounds unwise to let user space pass an unchecked 32-bit > > offset into a kernel structure in an ioctl. This is an unsigned > > variable, so checking the upper bound for

Re: [PATCH 2/3] scsi: megaraid_sas: check user-provided offsets

2020-12-30 Thread Phil Oester
On Tue, Sep 08, 2020 at 11:36:22PM +0200, Arnd Bergmann wrote: > It sounds unwise to let user space pass an unchecked 32-bit > offset into a kernel structure in an ioctl. This is an unsigned > variable, so checking the upper bound for the size of the structure > it points into is sufficient to

Re: [PATCH 2/3] scsi: megaraid_sas: check user-provided offsets

2020-09-12 Thread Arnd Bergmann
On Sat, Sep 12, 2020 at 9:20 AM Christoph Hellwig wrote: > On Tue, Sep 08, 2020 at 11:36:22PM +0200, Arnd Bergmann wrote: > > Cc: sta...@vger.kernel.org > > What about a Fixes tag instead? Sure, I can add that. It's been broken since 2.6.15 though, when the driver was initially merged.

Re: [PATCH 2/3] scsi: megaraid_sas: check user-provided offsets

2020-09-12 Thread Christoph Hellwig
On Tue, Sep 08, 2020 at 11:36:22PM +0200, Arnd Bergmann wrote: > It sounds unwise to let user space pass an unchecked 32-bit > offset into a kernel structure in an ioctl. This is an unsigned > variable, so checking the upper bound for the size of the structure > it points into is sufficient to

[PATCH 2/3] scsi: megaraid_sas: check user-provided offsets

2020-09-08 Thread Arnd Bergmann
It sounds unwise to let user space pass an unchecked 32-bit offset into a kernel structure in an ioctl. This is an unsigned variable, so checking the upper bound for the size of the structure it points into is sufficient to avoid data corruption, but as the pointer might also be unaligned, it has