]> git.baikalelectronics.ru Git - kernel.git/commit
proc: avoid integer type confusion in get_proc_long
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 5 Dec 2022 19:33:40 +0000 (11:33 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 5 Dec 2022 19:33:40 +0000 (11:33 -0800)
commit567194314d3988d84d6f93c8604bfd8ad734d056
tree99980bc2f566db463d0080a56af31d6b76e230bd
parent7358f5450f43be1de0ce66e48b0ab3147e7efcf0
proc: avoid integer type confusion in get_proc_long

proc_get_long() is passed a size_t, but then assigns it to an 'int'
variable for the length.  Let's not do that, even if our IO paths are
limited to MAX_RW_COUNT (exactly because of these kinds of type errors).

So do the proper test in the rigth type.

Reported-by: Kyle Zeng <zengyhkyle@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/sysctl.c