[PATCH 0/2] sysctl: fix range-checking in do_proc_dointvec_minmax_conv()

From: Zev Weiss
Date: Thu Dec 27 2018 - 06:19:29 EST


After being left with an unusable system after a typo executing
something like 'echo $((1<<24)) > /proc/sys/vm/max_map_count', I found
that do_proc_dointvec_minmax_conv() was missing a check to ensure that
the converted value actually fits in an int.

The first of the following patches enhances the sysctl selftest such
that it detects this problem; the second fixes it (wasn't entirely
sure if this would meet the criteria of something that should be sent
to -stable; input welcome).

Zev Weiss