]> 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)
commit1acd5b55aa99941885f2c39e3af67c6cdd0ef6e0
treee41b3286e8a9a62b0ded02ecd7b63c057cd39660
parent9996f3911fc5ae09fc6193df897e3e8b6c125a8e
parente4cbe5f80dc30df32c1020237a8a756fcd25a7c1
Merge branch 'skb-drop-reason-boundary'

Menglong Dong says:

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

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