All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Sukholitko <boris.sukholitko@broadcom.com>
To: netdev@vger.kernel.org, Jamal Hadi Salim <jhs@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>,
	Cong Wang <xiyou.wangcong@gmail.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	wangqing@vivo.com, wenxu@ucloud.cn, eranbe@nvidia.com,
	dcaratti@redhat.com, gustavoars@kernel.org, zhangkaiheb@126.com,
	vladimir.oltean@nxp.com, alobakin@pm.me,
	Ilya Lifshits <ilya.lifshits@broadcom.com>
Subject: Re: [PATCH net-next] net: flow_dissector: do not set invalid PPP protocol
Date: Sun, 3 Oct 2021 10:38:18 +0300	[thread overview]
Message-ID: <20211003073818.GA3433@noodle> (raw)
In-Reply-To: <20211003071345.1661-1-boris.sukholitko@broadcom.com>

[-- Attachment #1: Type: text/plain, Size: 1416 bytes --]

Hi,

Please disregard, I see that the patch has been applied already.

My feeble defense is that the previous patch has "Not Applicable" state
on patchwork for some reason:

https://patchwork.kernel.org/project/netdevbpf/patch/20210929113223.22108-1-boris.sukholitko@broadcom.com/

Thanks,
Boris.

On Sun, Oct 03, 2021 at 10:13:45AM +0300, Boris Sukholitko wrote:
> The following flower filter fails to match non-PPP_IP{V6} packets
> wrapped in PPP_SES protocol:
> 
> tc filter add dev eth0 ingress protocol ppp_ses flower \
>         action simple sdata hi64
> 
> The reason is that proto local variable is being set even when
> FLOW_DISSECT_RET_OUT_BAD status is returned.
> 
> The fix is to avoid setting proto variable if the PPP protocol is unknown.
> 
> Signed-off-by: Boris Sukholitko <boris.sukholitko@broadcom.com>
> ---
>  net/core/flow_dissector.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
> index bac0184cf3de..7d0a9f84aaf7 100644
> --- a/net/core/flow_dissector.c
> +++ b/net/core/flow_dissector.c
> @@ -1196,9 +1196,8 @@ bool __skb_flow_dissect(const struct net *net,
>  			break;
>  		}
>  
> -		proto = hdr->proto;
>  		nhoff += PPPOE_SES_HLEN;
> -		switch (proto) {
> +		switch (hdr->proto) {
>  		case htons(PPP_IP):
>  			proto = htons(ETH_P_IP);
>  			fdret = FLOW_DISSECT_RET_PROTO_AGAIN;
> -- 
> 2.29.2
> 

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4221 bytes --]

      reply	other threads:[~2021-10-03  7:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-03  7:13 [PATCH net-next] net: flow_dissector: do not set invalid PPP protocol Boris Sukholitko
2021-10-03  7:38 ` Boris Sukholitko [this message]

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=20211003073818.GA3433@noodle \
    --to=boris.sukholitko@broadcom.com \
    --cc=alobakin@pm.me \
    --cc=davem@davemloft.net \
    --cc=dcaratti@redhat.com \
    --cc=eranbe@nvidia.com \
    --cc=gustavoars@kernel.org \
    --cc=ilya.lifshits@broadcom.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vladimir.oltean@nxp.com \
    --cc=wangqing@vivo.com \
    --cc=wenxu@ucloud.cn \
    --cc=xiyou.wangcong@gmail.com \
    --cc=zhangkaiheb@126.com \
    /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.