Skip to contentSkip to conversation

scsi: qedi,qedf: Use designated initializers

PATCH Applied Kees Cook 3 participants 3 messages Mar 29, 2017 – Apr 20, 2017

Subsystems (3)
lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 scsi: qedi,qedf: Use designated initializers

Prepare to mark sensitive kernel structures for randomization by making sure they're using designated initializers. These were identified during allyesconfig builds of x86, arm, and arm64, with most initializer fixes extracted from grsecurity.

For these cases, terminate the list with { }, which will be zero-filled, instead of undesignated NULLs.

---
 drivers/scsi/qedf/qedf_debugfs.c | 2 +-
 drivers/scsi/qedi/qedi_debugfs.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/qedf/qedf_debugfs.c +1 -1
index cb08b625c594..00a1d6405ebe 100644
@@ -449,7 +449,7 @@ const struct file_operations qedf_dbg_fops[] = {
 	qedf_dbg_fileops(qedf, clear_stats),
 	qedf_dbg_fileops_seq(qedf, offload_stats),
 	/* This must be last */
-	{ NULL, NULL },
+	{ },
 };
 
 #else /* CONFIG_DEBUG_FS */
drivers/scsi/qedi/qedi_debugfs.c +1 -1
index 59417199bf36..39d77818a677 100644
@@ -240,5 +240,5 @@ const struct file_operations qedi_dbg_fops[] = {
 	qedi_dbg_fileops_seq(qedi, gbl_ctx),
 	qedi_dbg_fileops(qedi, do_not_recover),
 	qedi_dbg_fileops_seq(qedi, io_trace),
-	{ NULL, NULL },
+	{ },
 };
Signature · 6 lines
2.7.4


-- 
Kees Cook
Pixel Security
#2 lore raw
In reply to Kees Cook

Kees,

Quoted 7 lines

Prepare to mark sensitive kernel structures for randomization by making sure they're using designated initializers. These were identified during allyesconfig builds of x86, arm, and arm64, with most initializer fixes extracted from grsecurity.

For these cases, terminate the list with { }, which will be zero-filled, instead of undesignated NULLs.

Applied to 4.12/scsi-queue. Thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering