linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] scsi: aacraid: Replace one-element arrays with flexible-array members
@ 2022-02-22  7:28 Gustavo A. R. Silva
  2022-02-22  7:28 ` [PATCH 1/8][next] scsi: aacraid: Replace one-element array with flexible-array member Gustavo A. R. Silva
                   ` (8 more replies)
  0 siblings, 9 replies; 14+ messages in thread
From: Gustavo A. R. Silva @ 2022-02-22  7:28 UTC (permalink / raw)
  To: linux-scsi, linux-kernel
  Cc: Adaptec OEM Raid Solutions, James E.J. Bottomley,
	Martin K. Petersen, linux-hardening, Gustavo A. R. Silva

This series aims to replace one-element arrays with flexible-array
members in multiple structures in drivers/scsi/aacraid/aacraid.h.

There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use “flexible array members”[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].

This helps with the ongoing efforts to globally enable -Warray-bounds
and get us closer to being able to tighten the FORTIFY_SOURCE routines
on memcpy().

These issues were found with the help of Coccinelle and audited and fixed,
manually.

[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays

Link: https://github.com/KSPP/linux/issues/79

Gustavo A. R. Silva (8):
  scsi: aacraid: Replace one-element array with flexible-array member
  scsi: aacraid: Replace one-element array with flexible-array member in
    struct sgmap
  scsi: aacraid: Replace one-element array with flexible-array member in
    struct user_sgmap
  scsi: aacraid: Replace one-element array with flexible-array member in
    struct sgmap64
  scsi: aacraid: Replace one-element array with flexible-array member in
    struct user_sgmap64
  scsi: aacraid: Replace one-element array with flexible-array member in
    struct sgmapraw
  scsi: aacraid: Replace one-element array with flexible-array member in
    struct user_sgmapraw
  scsi: aacraid: Replace one-element array with flexible-array member in
    struct aac_aifcmd

 drivers/scsi/aacraid/aachba.c   | 76 +++++++++++----------------------
 drivers/scsi/aacraid/aacraid.h  | 16 +++----
 drivers/scsi/aacraid/commctrl.c |  5 +--
 drivers/scsi/aacraid/comminit.c |  3 +-
 4 files changed, 37 insertions(+), 63 deletions(-)

-- 
2.27.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-06-23 16:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-22  7:28 [PATCH 0/8] scsi: aacraid: Replace one-element arrays with flexible-array members Gustavo A. R. Silva
2022-02-22  7:28 ` [PATCH 1/8][next] scsi: aacraid: Replace one-element array with flexible-array member Gustavo A. R. Silva
2022-02-22  7:29 ` [PATCH 2/8][next] scsi: aacraid: Replace one-element array with flexible-array member in struct sgmap Gustavo A. R. Silva
2022-02-22  7:29 ` [PATCH 3/8][next] scsi: aacraid: Replace one-element array with flexible-array member in struct user_sgmap Gustavo A. R. Silva
2022-02-22  7:30 ` [PATCH 4/8][next] scsi: aacraid: Replace one-element array with flexible-array member in struct sgmap64 Gustavo A. R. Silva
2022-02-22  7:30 ` [PATCH 5/8][next] scsi: aacraid: Replace one-element array with flexible-array member in struct user_sgmap64 Gustavo A. R. Silva
2022-02-22  7:30 ` [PATCH 6/8][next] scsi: aacraid: Replace one-element array with flexible-array member in struct sgmapraw Gustavo A. R. Silva
2022-02-22  7:30 ` [PATCH 7/8][next] scsi: aacraid: Replace one-element array with flexible-array member in struct user_sgmapraw Gustavo A. R. Silva
2022-02-22  7:31 ` [PATCH 8/8][next] scsi: aacraid: Replace one-element array with flexible-array member in struct aac_aifcmd Gustavo A. R. Silva
2022-06-23 16:29   ` Kees Cook
2022-03-10  4:03 ` [PATCH 0/8] scsi: aacraid: Replace one-element arrays with flexible-array members Gustavo A. R. Silva
2022-03-15  4:02   ` Martin K. Petersen
2022-03-15  4:22     ` Gustavo A. R. Silva
2022-06-23 16:26       ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).