sysctl: fix null checking in bin_dn_node_address()
authorXi Wang <xi.wang@gmail.com>
Thu, 28 Feb 2013 01:05:21 +0000 (17:05 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Mar 2013 22:03:36 +0000 (06:03 +0800)
commit603e070fed3c15250c98b5de8af1db0f0647ff3c
tree08d3489213e4fb3eb726f2e508427172bb7dbfa7
parentfd9471ef7e6ee38a7f29f5556928ddf4824f8bdd
sysctl: fix null checking in bin_dn_node_address()

commit df1778be1a33edffa51d094eeda87c858ded6560 upstream.

The null check of `strchr() + 1' is broken, which is always non-null,
leading to OOB read.  Instead, check the result of strchr().

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/sysctl_binary.c