stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Liping Zhang <zlpnobody@gmail.com>,
	Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: [PATCH 4.9 16/41] sysctl: report EINVAL if value is larger than UINT_MAX for proc_douintvec
Date: Mon, 10 Jul 2017 19:10:49 +0200	[thread overview]
Message-ID: <20170710171052.537094542@linuxfoundation.org> (raw)
In-Reply-To: <20170710171051.866846041@linuxfoundation.org>

4.9-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Liping Zhang <zlpnobody@gmail.com>

commit 425fffd886bae3d127a08fa6a17f2e31e24ed7ff upstream.

Currently, inputting the following command will succeed but actually the
value will be truncated:

  # echo 0x12ffffffff > /proc/sys/net/ipv4/tcp_notsent_lowat

This is not friendly to the user, so instead, we should report error
when the value is larger than UINT_MAX.

Fixes: e7d316a02f68 ("sysctl: handle error writing UINT_MAX to u32 fields")
Signed-off-by: Liping Zhang <zlpnobody@gmail.com>
Cc: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/sysctl.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -2146,6 +2146,8 @@ static int do_proc_douintvec_conv(bool *
 	if (write) {
 		if (*negp)
 			return -EINVAL;
+		if (*lvalp > UINT_MAX)
+			return -EINVAL;
 		*valp = *lvalp;
 	} else {
 		unsigned int val = *valp;

  parent reply	other threads:[~2017-07-10 17:14 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-10 17:10 [PATCH 4.9 00/41] 4.9.37-stable review Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 01/41] fs: add a VALID_OPEN_FLAGS Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 02/41] fs: completely ignore unknown open flags Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 03/41] driver core: platform: fix race condition with driver_override Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 04/41] ceph: choose readdir frag based on previous readdir reply Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 05/41] tracing/kprobes: Allow to create probe with a module name starting with a digit Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 06/41] [media] media: entity: Fix stream count check Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 08/41] usb: dwc3: replace %p with %pK Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 09/41] USB: serial: cp210x: add ID for CEL EM3588 USB ZigBee stick Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 10/41] Add USB quirk for HVR-950q to avoid intermittent device resets Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 11/41] usb: usbip: set buffer pointers to NULL after free Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 12/41] usb: Fix typo in the definition of Endpoint[out]Request Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 13/41] USB: core: fix device node leak Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 14/41] mac80211_hwsim: Replace bogus hrtimer clockid Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 15/41] sysctl: dont print negative flag for proc_douintvec Greg Kroah-Hartman
2017-07-10 17:10 ` Greg Kroah-Hartman [this message]
2017-07-10 17:10 ` [PATCH 4.9 17/41] pinctrl: qcom: ipq4019: add missing pingroups for pins > 70 Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 18/41] pinctrl: cherryview: Add a quirk to make Acer Chromebook keyboard work again Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 19/41] pinctrl: sh-pfc: r8a7794: Swap ATA signals Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 20/41] pinctrl: sh-pfc: r8a7791: Fix SCIF2 pinmux data Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 21/41] pinctrl: sh-pfc: r8a7791: Add missing DVC_MUTE signal Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 22/41] pinctrl: sh-pfc: r8a7795: Fix hscif2_clk_b and hscif4_ctrl Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 23/41] pinctrl: meson: meson8b: fix the NAND DQS pins Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 24/41] pinctrl: stm32: Fix bad function call Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 25/41] pinctrl: sunxi: Fix SPDIF function name for A83T Greg Kroah-Hartman
2017-07-10 17:10 ` [PATCH 4.9 26/41] pinctrl: cherryview: Add terminate entry for dmi_system_id tables Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 28/41] pinctrl: sh-pfc: r8a7791: Add missing HSCIF1 pinmux data Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 29/41] pinctrl: sh-pfc: Update info pointer after SoC-specific init Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 32/41] xhci: Limit USB2 port wake support for AMD Promontory hosts Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 33/41] gfs2: Fix glock rhashtable rcu bug Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 34/41] tpm: fix a kernel memory leak in tpm-sysfs.c Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 36/41] x86/uaccess: Optimize copy_user_enhanced_fast_string() for short strings Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 37/41] ath10k: override CE5 config for QCA9377 Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 38/41] KEYS: Fix an error code in request_master_key() Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 39/41] crypto: drbg - Fixes panic in wait_for_completion call Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 40/41] RDMA/uverbs: Check port number supplied by user verbs cmds Greg Kroah-Hartman
2017-07-10 17:11 ` [PATCH 4.9 41/41] rt286: add Thinkpad Helix 2 to force_combo_jack_table Greg Kroah-Hartman
2017-07-10 22:31 ` [PATCH 4.9 00/41] 4.9.37-stable review Krister Johansen
2017-07-11  9:53   ` Greg Kroah-Hartman
2017-07-11  0:45 ` Guenter Roeck
2017-07-11  9:54 ` Sumit Semwal
2017-07-11 10:37   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170710171052.537094542@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=subashab@codeaurora.org \
    --cc=torvalds@linux-foundation.org \
    --cc=zlpnobody@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).