[PATCH 0/2] scsi: aacraid: struct sgmap: Replace 1-element arrays with flexible arrays

Kees Cook posted 2 patches 1 year, 5 months ago
drivers/scsi/aacraid/aachba.c   | 26 ++++++++++++--------------
drivers/scsi/aacraid/aacraid.h  | 17 ++++++-----------
drivers/scsi/aacraid/commctrl.c |  4 ++--
drivers/scsi/aacraid/comminit.c |  3 +--
drivers/scsi/aacraid/commsup.c  |  5 +++--
5 files changed, 24 insertions(+), 31 deletions(-)
[PATCH 0/2] scsi: aacraid: struct sgmap: Replace 1-element arrays with flexible arrays
Posted by Kees Cook 1 year, 5 months ago
Hi,

This replaces some of the last remaining uses in the kernel of 1-element
"fake" flexible arrays with modern C99 flexible arrays. Some refactoring
is done to ease this, and binary differences are identified. For the
on stack size changes in patch 2, the "yes, that is the source of the binary
differences" debugging patch can be found here[1].

Thanks!

-Kees

[1] https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git/commit/?h=dev/v6.10-rc2/1-element&id=45e6226bcbc5e982541754eca7ac29f403e82f5e

Kees Cook (2):
  scsi: aacraid: Rearrange order of struct aac_srb_unit
  scsi: aacraid: struct {user,}sgmap{,64,raw}: Replace 1-element arrays
    with flexible arrays

 drivers/scsi/aacraid/aachba.c   | 26 ++++++++++++--------------
 drivers/scsi/aacraid/aacraid.h  | 17 ++++++-----------
 drivers/scsi/aacraid/commctrl.c |  4 ++--
 drivers/scsi/aacraid/comminit.c |  3 +--
 drivers/scsi/aacraid/commsup.c  |  5 +++--
 5 files changed, 24 insertions(+), 31 deletions(-)

-- 
2.34.1
Re: [PATCH 0/2] scsi: aacraid: struct sgmap: Replace 1-element arrays with flexible arrays
Posted by Martin K. Petersen 1 year, 4 months ago
On Thu, 11 Jul 2024 14:57:36 -0700, Kees Cook wrote:

> This replaces some of the last remaining uses in the kernel of 1-element
> "fake" flexible arrays with modern C99 flexible arrays. Some refactoring
> is done to ease this, and binary differences are identified. For the
> on stack size changes in patch 2, the "yes, that is the source of the binary
> differences" debugging patch can be found here[1].
> 
> Thanks!
> 
> [...]

Applied to 6.12/scsi-queue, thanks!

[1/2] scsi: aacraid: Rearrange order of struct aac_srb_unit
      https://git.kernel.org/mkp/scsi/c/6e5860b0ad49
[2/2] scsi: aacraid: struct {user,}sgmap{,64,raw}: Replace 1-element arrays with flexible arrays
      https://git.kernel.org/mkp/scsi/c/fdb1db6ea7f6

-- 
Martin K. Petersen	Oracle Linux Engineering
Re: [PATCH 0/2] scsi: aacraid: struct sgmap: Replace 1-element arrays with flexible arrays
Posted by Martin K. Petersen 1 year, 4 months ago
Kees,

> This replaces some of the last remaining uses in the kernel of
> 1-element "fake" flexible arrays with modern C99 flexible arrays. Some
> refactoring is done to ease this, and binary differences are
> identified. For the on stack size changes in patch 2, the "yes, that
> is the source of the binary differences" debugging patch can be found
> here[1].

Applied to 6.12/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering