From: David Miller <davem@davemloft.net>
To: weiwan@google.com
Cc: netdev@vger.kernel.org, edumazet@google.com
Subject: Re: [PATCH net] ipv6: take rcu lock in rawv6_send_hdrinc()
Date: Fri, 05 Oct 2018 14:46:29 -0700 (PDT) [thread overview]
Message-ID: <20181005.144629.1332596138050709254.davem@davemloft.net> (raw)
In-Reply-To: <20181004171237.181701-1-tracywwnj@gmail.com>
From: Wei Wang <weiwan@google.com>
Date: Thu, 4 Oct 2018 10:12:37 -0700
> From: Wei Wang <weiwan@google.com>
>
> In rawv6_send_hdrinc(), in order to avoid an extra dst_hold(), we
> directly assign the dst to skb and set passed in dst to NULL to avoid
> double free.
> However, in error case, we free skb and then do stats update with the
> dst pointer passed in. This causes use-after-free on the dst.
> Fix it by taking rcu read lock right before dst could get released to
> make sure dst does not get freed until the stats update is done.
> Note: we don't have this issue in ipv4 cause dst is not used for stats
> update in v4.
>
> Syzkaller reported following crash:
...
> Fixes: 1789a640f556 ("raw: avoid two atomics in xmit")
> Signed-off-by: Wei Wang <weiwan@google.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied and queued up for -stable, thanks.
prev parent reply other threads:[~2018-10-06 4:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-04 17:12 [PATCH net] ipv6: take rcu lock in rawv6_send_hdrinc() Wei Wang
2018-10-05 21:46 ` 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=20181005.144629.1332596138050709254.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.org \
--cc=weiwan@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;
as well as URLs for NNTP newsgroup(s).