]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'skb-drop-reason-boundary'
authorDavid S. Miller <davem@davemloft.net>
Mon, 16 May 2022 09:47:44 +0000 (10:47 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 May 2022 09:47:44 +0000 (10:47 +0100)
commit6584f49ab76f57f1113bf7e3eadb806ea7323ea8
treee41b3286e8a9a62b0ded02ecd7b63c057cd39660
parent48ba264a0633ed748381eaff14ec7abbc9078135
parent0c180e42937db5ac830f99c1411c8f4d06cb7de1
Merge branch 'skb-drop-reason-boundary'

Menglong Dong says:

====================
net: skb: check the boundrary of skb drop reason

In the commit dc9ebcc8b851 ("skb: make drop reason booleanable"),
SKB_NOT_DROPPED_YET is added to the enum skb_drop_reason, which makes
the invalid drop reason SKB_NOT_DROPPED_YET can leak to the kfree_skb
tracepoint. Once this happen (it happened, as 4th patch says), it can
cause NULL pointer in drop monitor and result in kernel panic.

Therefore, check the boundrary of drop reason in both kfree_skb_reason
(2th patch) and drop monitor (1th patch) to prevent such case happens
again.

Meanwhile, fix the invalid drop reason passed to kfree_skb_reason() in
tcp_v4_rcv() and tcp_v6_rcv().

Changes since v2:
1/4 - don't reset the reason and print the debug warning only (Jakub
      Kicinski)
4/4 - remove new lines between tags

Changes since v1:
- consider tcp_v6_rcv() in the 4th patch
====================

Signed-off-by: David S. Miller <davem@davemloft.net>