Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hugetlb: fix handling of parse errors in sysfs
When parsing changes to the huge page pool sizes made from userspace via the sysfs interface, bogus input values are being covered up by nr_hugepages_store_common and nr_overcommit_hugepages_store returning 0 when strict_strtoul returns an error. This can cause an infinite loop in the nr_hugepages_store code. This patch changes the return value for these functions to -EINVAL when strict_strtoul returns an error. Signed-off-by: Eric B Munson <[email protected]> Reported-by: CAI Qian <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Eric B Munson <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Nishanth Aravamudan <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information