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)
commit6ee1d84b2b78af4cff0d9714da81c752baf4b01e
treee41b3286e8a9a62b0ded02ecd7b63c057cd39660
parent3aba103006bcc4a7472b7c9506b3bc065ffb7992
parentf8319dfd1b3b3be6c08795017fc30f880f8bc861
Merge branch 'skb-drop-reason-boundary'

Menglong Dong says:

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

In the commit 1330b6ef3313 ("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>