]> git.baikalelectronics.ru Git - kernel.git/commit
net: tcp: reset 'drop_reason' to NOT_SPCIFIED in tcp_v{4,6}_rcv()
authorMenglong Dong <imagedong@tencent.com>
Fri, 13 May 2022 03:03:39 +0000 (11:03 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 May 2022 09:47:44 +0000 (10:47 +0100)
commit0c180e42937db5ac830f99c1411c8f4d06cb7de1
treee41b3286e8a9a62b0ded02ecd7b63c057cd39660
parentfc7ac21eb47106e5b444817dbd23fdb32b5b04fc
net: tcp: reset 'drop_reason' to NOT_SPCIFIED in tcp_v{4,6}_rcv()

The 'drop_reason' that passed to kfree_skb_reason() in tcp_v4_rcv()
and tcp_v6_rcv() can be SKB_NOT_DROPPED_YET(0), as it is used as the
return value of tcp_inbound_md5_hash().

And it can panic the kernel with NULL pointer in
net_dm_packet_report_size() if the reason is 0, as drop_reasons[0]
is NULL.

Fixes: dc9ebcc8b851 ("skb: make drop reason booleanable")
Reviewed-by: Jiang Biao <benbjiang@tencent.com>
Reviewed-by: Hao Peng <flyingpeng@tencent.com>
Signed-off-by: Menglong Dong <imagedong@tencent.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_ipv4.c
net/ipv6/tcp_ipv6.c