]> git.baikalelectronics.ru Git - kernel.git/commit
mm, hugetlb: remove unnecessary lower bound on sysctl handlers"?
authorAndrey Ryabinin <a.ryabinin@samsung.com>
Tue, 10 Feb 2015 22:11:33 +0000 (14:11 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 10 Feb 2015 22:30:34 +0000 (14:30 -0800)
commit837bc0661d7783b858fe9650b982166b96535f48
treede8c142b3f4b050c5fa6ff85b700437c0443cbc4
parent5db3917471078687d1997219fa322288b30742e0
mm, hugetlb: remove unnecessary lower bound on sysctl handlers"?

Commit 3683dbce245e ("mm, hugetlb: remove hugetlb_zero and
hugetlb_infinity") replaced 'unsigned long hugetlb_zero' with 'int zero'
leading to out-of-bounds access in proc_doulongvec_minmax().  Use
'.extra1 = NULL' instead of '.extra1 = &zero'.  Passing NULL is
equivalent to passing minimal value, which is 0 for unsigned types.

Fixes: 3683dbce245e ("mm, hugetlb: remove hugetlb_zero and hugetlb_infinity")
Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Suggested-by: Manfred Spraul <manfred@colorfullife.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/sysctl.c