Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hugetlb: check the return value of string conversion in sysctl handler
proc_doulongvec_minmax may fail if the given buffer doesn't represent a valid number. If we provide something invalid we will initialize the resulting value (nr_overcommit_huge_pages in this case) to a random value from the stack. The issue was introduced by a3d0c6a when the default handler has been replaced by the helper function where we do not check the return value. Reproducer: echo "" > /proc/sys/vm/nr_overcommit_hugepages [[email protected]: correctly propagate proc_doulongvec_minmax return code] Signed-off-by: Michal Hocko <[email protected]> Cc: CAI Qian <[email protected]> Cc: Nishanth Aravamudan <[email protected]> Cc: Andrea Arcangeli <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information