]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: fix out-of-bounds access in ULP sysctl
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 23 Jun 2017 01:57:55 +0000 (18:57 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Jun 2017 18:10:05 +0000 (14:10 -0400)
commitb2788dddf870e4a5550267b7ad8e73c4246f1ef6
tree8bece0c7338621cebdf5978d5ebce396a2309ac2
parent7c1baa146e79e10a88c99f75800429668095dfc9
tcp: fix out-of-bounds access in ULP sysctl

KASAN reports out-of-bound access in proc_dostring() coming from
proc_tcp_available_ulp() because in case TCP ULP list is empty
the buffer allocated for the response will not have anything
printed into it.  Set the first byte to zero to avoid strlen()
going out-of-bounds.

Fixes: 83c82325ff1c ("tcp: ULP infrastructure")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_ulp.c