netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: liuhangbin@gmail.com
Cc: netdev@vger.kernel.org, sbrivio@redhat.com, wenxu@ucloud.cn,
	ast@fb.com, eric.dumazet@gmail.com, ja@ssi.bg
Subject: Re: [PATCHv4 0/2] fix dev null pointer dereference when send packets larger than mtu in collect_md mode
Date: Sat, 24 Aug 2019 14:51:01 -0700 (PDT)	[thread overview]
Message-ID: <20190824.145101.762776744197266351.davem@davemloft.net> (raw)
In-Reply-To: <20190822141949.29561-1-liuhangbin@gmail.com>

From: Hangbin Liu <liuhangbin@gmail.com>
Date: Thu, 22 Aug 2019 22:19:47 +0800

> When we send a packet larger than PMTU, we need to reply with
> icmp_send(ICMP_FRAG_NEEDED) or icmpv6_send(ICMPV6_PKT_TOOBIG).
> 
> But with collect_md mode, kernel will crash while accessing the dst dev
> as __metadata_dst_init() init dst->dev to NULL by default. Here is what
> the code path looks like, for GRE:
 ...
> We could not fix it in __metadata_dst_init() as there is no dev supplied.
> Look in to the __icmp_send()/decode_session{4,6} code we could find the dst
> dev is actually not needed. In __icmp_send(), we could get the net by skb->dev.
> For decode_session{4,6}, as it was called by xfrm_decode_session_reverse()
> in this scenario, the oif is not used by
> fl4->flowi4_oif = reverse ? skb->skb_iif : oif;
> 
> The reproducer is easy:
 ...

Series applied, and queued up for -stable, thanks!

      parent reply	other threads:[~2019-08-24 21:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-15  6:09 [PATCH net] tunnel: fix dev null pointer dereference when send pkg larger than mtu in collect_md mode Hangbin Liu
2019-08-15  9:16 ` Eric Dumazet
2019-08-16  3:24   ` Hangbin Liu
2019-08-16  4:01     ` Hangbin Liu
2019-08-16  8:23     ` Eric Dumazet
2019-08-16 10:51       ` Hangbin Liu
2019-08-19  7:53 ` [PATCHv2 0/2] " Hangbin Liu
2019-08-19  7:53   ` [PATCH 1/2] ipv4/icmp: fix rt dst dev null pointer dereference Hangbin Liu
2019-08-21 16:11     ` Julian Anastasov
2019-08-19  7:53   ` [PATCH 2/2] xfrm/xfrm_policy: fix dst dev null pointer dereference in collect_md mode Hangbin Liu
2019-08-20 19:20   ` [PATCHv2 0/2] fix dev null pointer dereference when send pkg larger than mtu " David Miller
2019-08-21  2:09 ` [PATCHv3 0/2] fix dev null pointer dereference when send packets " Hangbin Liu
2019-08-21  2:09   ` [PATCHv3 1/2] ipv4/icmp: fix rt dst dev null pointer dereference Hangbin Liu
2019-08-21  2:09   ` [PATCHv3 2/2] xfrm/xfrm_policy: fix dst dev null pointer dereference in collect_md mode Hangbin Liu
2019-08-22 14:19 ` [PATCHv4 0/2] fix dev null pointer dereference when send packets larger than mtu " Hangbin Liu
2019-08-22 14:19   ` [PATCHv4 net 1/2] ipv4/icmp: fix rt dst dev null pointer dereference Hangbin Liu
2019-08-22 18:46     ` Julian Anastasov
2019-08-23 22:32     ` Jonathan Lemon
2019-08-22 14:19   ` [PATCHv4 net 2/2] xfrm/xfrm_policy: fix dst dev null pointer dereference in collect_md mode Hangbin Liu
2019-08-23 22:30     ` Jonathan Lemon
2019-08-24 21:51   ` David Miller [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=20190824.145101.762776744197266351.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=ast@fb.com \
    --cc=eric.dumazet@gmail.com \
    --cc=ja@ssi.bg \
    --cc=liuhangbin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=sbrivio@redhat.com \
    --cc=wenxu@ucloud.cn \
    /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;
as well as URLs for NNTP newsgroup(s).