From: "kongweibin (A)" <kongweibin2@huawei.com>
To: Eric Dumazet <edumazet@gmail.com>,
Nicolas Dichtel <nicolas.dichtel@6wind.com>,
Eric Dumazet <edumazet@google.com>
Cc: David Miller <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Willem de Bruijn <willemb@google.com>,
Pavel Begunkov <asml.silence@gmail.com>,
David Ahern <dsahern@kernel.org>,
Vasily Averin <vvs@virtuozzo.com>,
Martin KaFai Lau <kafai@fb.com>,
LKML <linux-kernel@vger.kernel.org>,
netdev <netdev@vger.kernel.org>,
"Chenxiang (EulerOS)" <rose.chen@huawei.com>,
liaichun <liaichun@huawei.com>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: 答复: [PATCH net] ipv6: fix panic when forwarding a pkt with no in6 dev
Date: Mon, 11 Apr 2022 06:44:03 +0000 [thread overview]
Message-ID: <01f85507886e435e97cc86f19abf0661@huawei.com> (raw)
In-Reply-To: <85da2373-d8ec-0049-bd3d-6b8f4b044edc@gmail.com>
> kongweibin, could you test this patch with your setup?
>
> Thanks,
> Nicolas
>
> net/ipv6/ip6_output.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index
> e23f058166af..fa63ef2bd99c 100644
> --- a/net/ipv6/ip6_output.c
> +++ b/net/ipv6/ip6_output.c
> @@ -485,7 +485,7 @@ int ip6_forward(struct sk_buff *skb)
> goto drop;
>
> if (!net->ipv6.devconf_all->disable_policy &&
> - !idev->cnf.disable_policy &&
> + (!idev || !idev->cnf.disable_policy) &&
> !xfrm6_policy_check(NULL, XFRM_POLICY_FWD, skb)) {
> __IP6_INC_STATS(net, idev, IPSTATS_MIB_INDISCARDS);
> goto drop;
I have test the patch with my setup, it is OK.
>> kongweibin reported a kernel panic in ip6_forward() when input
>> interface has no in6 dev associated.
>>
>> The following tc commands were used to reproduce this panic:
>> tc qdisc del dev vxlan100 root
>> tc qdisc add dev vxlan100 root netem corrupt 5%
>
>Not sure I understand how these qdisc changes can trigger a NULL idev ?
>
>Do we have another bug, like skb->cb[] content being mangled ?
>
As for why qdisc makes the idev null, I tracked where the iif assigned in ip6_rcv_core,
there is no problem there.
Not sure what has changed that makes the iif value wrong.
next prev parent reply other threads:[~2022-04-11 6:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-07 11:25 [PATCH] ipv6:fix crash when idev is NULL kongweibin
2022-04-07 14:08 ` Eric Dumazet
2022-04-07 16:10 ` Nicolas Dichtel
2022-04-08 14:03 ` [PATCH net] ipv6: fix panic when forwarding a pkt with no in6 dev Nicolas Dichtel
2022-04-08 22:18 ` Eric Dumazet
2022-04-11 6:44 ` kongweibin (A) [this message]
2022-04-11 1:11 ` David Ahern
2022-04-11 11:30 ` patchwork-bot+netdevbpf
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=01f85507886e435e97cc86f19abf0661@huawei.com \
--to=kongweibin2@huawei.com \
--cc=asml.silence@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@gmail.com \
--cc=edumazet@google.com \
--cc=kafai@fb.com \
--cc=kuba@kernel.org \
--cc=liaichun@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.dichtel@6wind.com \
--cc=rose.chen@huawei.com \
--cc=stable@vger.kernel.org \
--cc=vvs@virtuozzo.com \
--cc=willemb@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox