Re: [PATCH v2 4/6] sysctl: Fixes scsi_logging_level bounds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2/25/25 02:20, Martin K. Petersen wrote:
Hi Nicolas!

--- a/drivers/scsi/scsi_sysctl.c
+++ b/drivers/scsi/scsi_sysctl.c
@@ -17,7 +17,9 @@ static const struct ctl_table scsi_table[] = {
  	  .data		= &scsi_logging_level,
  	  .maxlen	= sizeof(scsi_logging_level),
  	  .mode		= 0644,
-	  .proc_handler	= proc_dointvec },
+	  .proc_handler	= proc_dointvec_minmax,
+	  .extra1	= SYSCTL_ZERO,
+	  .extra2	= SYSCTL_INT_MAX },
scsi_logging_level is a bitmask and should be unsigned.


Hi Martin,

Thank's for your review.

Does `scsi_logging_level` needs the full range of a unsigned 32-bit integer ?
As it was using `proc_dointvec`, it was capped to an INT_MAX.

If it effectively need the full range of an unsigned 32-bit integer, the
`proc_handler` could be changed to `proc_douintvec` as suggested by Chuck.

Best regards,

Nicolas





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux