sysctl: fix range-checking in do_proc_dointvec_minmax_conv()
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest3 patches 2 repliesIn review
- v12 patches 2 repliesSuperseded
Changes in v2 from the cover letter
- Rearranged selftest to also test negative values and provide more info in comments
- Added intermediate patch as a minimal fix for -stable without the refactoring
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | test_sysctl: add tests for >32-bit values written to 32-bit integerstools/ | +55 | 0 replies | |
| 2/3 | kernel/sysctl.c: add missing range check in do_proc_dointvec_minmax_convkernel/ | +10 | 0 replies | |
| 3/3 | kernel/sysctl.c: define minmax conv functions in terms of non-minmax versionskernel/ | +27 | 0 replies | |
| 3/3 | kernel/sysctl.c: define minmax conv functions in terms of non-minmax versionskernel/ | +27 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/3] sysctl: fix range-checking in do_proc_dointvec_minmax_conv()
Hello,
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 provides a minimal fix (suitable for -stable) such that the selftest passes. The third patch then performs a more thorough refactoring to eliminate the code duplication that led to the bug in the first place (maintaining the passing status of the selftest).
Changes in v2:
- Rearranged selftest to also test negative values and provide more info in comments
- Added intermediate patch as a minimal fix for -stable without the refactoring
Thanks,
Zev Weiss