• Liping Zhang's avatar
    sysctl: don't print negative flag for proc_douintvec · 5380e564
    Liping Zhang authored
    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: e7d316a0 ("sysctl: handle error writing UINT_MAX to u32 fields")
    Signed-off-by: default avatarLiping Zhang <zlpnobody@gmail.com>
    Cc: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    5380e564
sysctl.c 67.4 KB