]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: fix null ptr deref in getsockopt(..., TCP_ULP, ...)
authorDave Watson <davejwatson@fb.com>
Mon, 26 Jun 2017 15:36:47 +0000 (08:36 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Jun 2017 19:39:11 +0000 (15:39 -0400)
commit0790edbc06a896d67989ede2592f4467223910e2
tree1f50a7a904e2e5a42cdc548763605151f3557b0c
parent6df83ae510d10911a9e1f221f1d3733adc8f897c
tcp: fix null ptr deref in getsockopt(..., TCP_ULP, ...)

If icsk_ulp_ops is unset, it dereferences a null ptr.
Add a null ptr check.

BUG: KASAN: null-ptr-deref in copy_to_user include/linux/uaccess.h:168 [inline]
BUG: KASAN: null-ptr-deref in do_tcp_getsockopt.isra.33+0x24f/0x1e30 net/ipv4/tcp.c:3057
Read of size 4 at addr 0000000000000020 by task syz-executor1/15452

Signed-off-by: Dave Watson <davejwatson@fb.com>
Reported-by: "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp.c