Skip to content

Commit 2cef5b4

Browse files
nbouchinet-anssimartinkpetersen
authored andcommitted
scsi: logging: Fix scsi_logging_level bounds
Bound scsi_logging_level sysctl writings between SYSCTL_ZERO and SYSCTL_INT_MAX. The proc_handler has thus been updated to proc_dointvec_minmax. Signed-off-by: Nicolas Bouchinet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Joel Granados <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent e6a8156 commit 2cef5b4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/scsi/scsi_sysctl.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ static const struct ctl_table scsi_table[] = {
1717
.data = &scsi_logging_level,
1818
.maxlen = sizeof(scsi_logging_level),
1919
.mode = 0644,
20-
.proc_handler = proc_dointvec },
20+
.proc_handler = proc_dointvec_minmax,
21+
.extra1 = SYSCTL_ZERO,
22+
.extra2 = SYSCTL_INT_MAX },
2123
};
2224

2325
static struct ctl_table_header *scsi_table_header;

0 commit comments

Comments
 (0)