Return-Path: Received: from thorn.bewilderbeest.net ([71.19.156.171]:58821 "EHLO thorn.bewilderbeest.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730421AbeL0LT1 (ORCPT ); Thu, 27 Dec 2018 06:19:27 -0500 From: Zev Weiss To: Luis Chamberlain , Kees Cook Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 0/2] sysctl: fix range-checking in do_proc_dointvec_minmax_conv() Date: Thu, 27 Dec 2018 05:12:28 -0600 Message-Id: <20181227111231.12912-1-zev@bewilderbeest.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 fixes it (wasn't entirely sure if this would meet the criteria of something that should be sent to -stable; input welcome). Thanks, Zev Weiss