All of lore.kernel.org
 help / color / mirror / Atom feed
From: menglong8.dong@gmail.com
To: kuba@kernel.org
Cc: nhorman@tuxdriver.com, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, yoshfuji@linux-ipv6.org, dsahern@kernel.org,
	imagedong@tencent.com, kafai@fb.com, talalahmad@google.com,
	keescook@chromium.org, asml.silence@gmail.com,
	willemb@google.com, vasily.averin@linux.dev,
	ilias.apalodimas@linaro.org, luiz.von.dentz@intel.com,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH net-next 0/4] net: skb: check the boundrary of skb drop reason
Date: Thu, 12 May 2022 14:26:25 +0800	[thread overview]
Message-ID: <20220512062629.10286-1-imagedong@tencent.com> (raw)

From: Menglong Dong <imagedong@tencent.com>

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).

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

Menglong Dong (4):
  net: dm: check the boundary of skb drop reasons
  net: skb: check the boundrary of drop reason in kfree_skb_reason()
  net: skb: change the definition SKB_DR_SET()
  net: tcp: reset skb drop reason to NOT_SPCIFIED in tcp_v4_rcv()

 include/linux/skbuff.h  | 3 ++-
 net/core/drop_monitor.c | 2 +-
 net/core/skbuff.c       | 5 +++++
 net/ipv4/tcp_ipv4.c     | 1 +
 4 files changed, 9 insertions(+), 2 deletions(-)

-- 
2.36.1


             reply	other threads:[~2022-05-12  6:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-12  6:26 menglong8.dong [this message]
2022-05-12  6:26 ` [PATCH net-next 1/4] net: dm: check the boundary of skb drop reasons menglong8.dong
2022-05-12  6:26 ` [PATCH net-next 2/4] net: skb: check the boundrary of drop reason in kfree_skb_reason() menglong8.dong
2022-05-12  6:26 ` [PATCH net-next 3/4] net: skb: change the definition SKB_DR_SET() menglong8.dong
2022-05-12  6:26 ` [PATCH net-next 4/4] net: tcp: reset skb drop reason to NOT_SPCIFIED in tcp_v4_rcv() menglong8.dong
2022-05-12 12:31 ` [PATCH net-next 0/4] net: skb: check the boundrary of skb drop reason Menglong Dong
2022-05-12 16:13   ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220512062629.10286-1-imagedong@tencent.com \
    --to=menglong8.dong@gmail.com \
    --cc=asml.silence@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=imagedong@tencent.com \
    --cc=kafai@fb.com \
    --cc=keescook@chromium.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.von.dentz@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=pabeni@redhat.com \
    --cc=talalahmad@google.com \
    --cc=vasily.averin@linux.dev \
    --cc=willemb@google.com \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.