diff options
author | Liping Zhang | 2017-04-07 10:51:06 -0500 |
---|---|---|
committer | Greg Kroah-Hartman | 2017-07-15 04:57:46 -0500 |
commit | e8505e6432c2eb7296d9c7724146d1ba1966a040 (patch) | |
tree | 147d294a04831f129d87ede024fdc4560e36f200 /kernel | |
parent | 2e42225b85ee59e3fea83895256386c1544adfa6 (diff) | |
download | kernel-omap-e8505e6432c2eb7296d9c7724146d1ba1966a040.tar.gz kernel-omap-e8505e6432c2eb7296d9c7724146d1ba1966a040.tar.xz kernel-omap-e8505e6432c2eb7296d9c7724146d1ba1966a040.zip |
sysctl: don't print negative flag for proc_douintvec
commit 5380e5644afbba9e3d229c36771134976f05c91e upstream.
I saw some very confusing sysctl output on my system:
# cat /proc/sys/net/core/xfrm_aevent_rseqth
-2
# cat /proc/sys/net/core/xfrm_aevent_etime
-10
# cat /proc/sys/net/ipv4/tcp_notsent_lowat
-4294967295
Because we forget to set the *negp flag in proc_douintvec, so it will
become a garbage value.
Since the value related to proc_douintvec is always an unsigned integer,
so we can set *negp to false explictily to fix this issue.
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sysctl.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 464a7864e4c5..5f3a51614ecf 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -2070,6 +2070,7 @@ static int do_proc_douintvec_conv(bool *negp, unsigned long *lvalp, | |||
2070 | *valp = *lvalp; | 2070 | *valp = *lvalp; |
2071 | } else { | 2071 | } else { |
2072 | unsigned int val = *valp; | 2072 | unsigned int val = *valp; |
2073 | *negp = false; | ||
2073 | *lvalp = (unsigned long)val; | 2074 | *lvalp = (unsigned long)val; |
2074 | } | 2075 | } |
2075 | return 0; | 2076 | return 0; |