public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel•org>
To: menglong8.dong@gmail•com
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: Re: [PATCH net-next v2 2/4] net: skb: check the boundrary of drop reason in kfree_skb_reason()
Date: Thu, 12 May 2022 09:15:58 -0700	[thread overview]
Message-ID: <20220512091558.350899ff@kernel.org> (raw)
In-Reply-To: <20220512123313.218063-3-imagedong@tencent.com>

On Thu, 12 May 2022 20:33:11 +0800 menglong8.dong@gmail•com wrote:
> +	if (unlikely(reason <= 0 || reason >= SKB_DROP_REASON_MAX)) {
> +		DEBUG_NET_WARN_ON_ONCE(1);
> +		reason = SKB_DROP_REASON_NOT_SPECIFIED;
> +	}

With drop_monitor fixes sending an invalid reason to the tracepoint
should be a minor bug, right?

Can we just have a:

	DEBUG_NET_WARN_ON_ONCE(reason <= 0 || reason >= SKB_DROP_REASON_MAX);

and avoid having this branch on non-debug builds?

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

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-12 12:33 [PATCH net-next v2 0/4] net: skb: check the boundrary of skb drop reason menglong8.dong
2022-05-12 12:33 ` [PATCH net-next v2 1/4] net: dm: check the boundary of skb drop reasons menglong8.dong
2022-05-12 12:33 ` [PATCH net-next v2 2/4] net: skb: check the boundrary of drop reason in kfree_skb_reason() menglong8.dong
2022-05-12 16:15   ` Jakub Kicinski [this message]
2022-05-12 16:16     ` Eric Dumazet
2022-05-13  2:41     ` Menglong Dong
2022-05-12 12:33 ` [PATCH net-next v2 3/4] net: skb: change the definition SKB_DR_SET() menglong8.dong
2022-05-12 12:33 ` [PATCH net-next v2 4/4] net: tcp: reset 'drop_reason' to NOT_SPCIFIED in tcp_v{4,6}_rcv() menglong8.dong
2022-05-12 16:16   ` 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=20220512091558.350899ff@kernel.org \
    --to=kuba@kernel$(echo .)org \
    --cc=asml.silence@gmail$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=dsahern@kernel$(echo .)org \
    --cc=edumazet@google$(echo .)com \
    --cc=ilias.apalodimas@linaro$(echo .)org \
    --cc=imagedong@tencent$(echo .)com \
    --cc=kafai@fb$(echo .)com \
    --cc=keescook@chromium$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=luiz.von.dentz@intel$(echo .)com \
    --cc=menglong8.dong@gmail$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=nhorman@tuxdriver$(echo .)com \
    --cc=pabeni@redhat$(echo .)com \
    --cc=talalahmad@google$(echo .)com \
    --cc=vasily.averin@linux$(echo .)dev \
    --cc=willemb@google$(echo .)com \
    --cc=yoshfuji@linux-ipv6$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox