From: David Miller <davem@davemloft.net>
To: mark.rutland@arm.com
Cc: linux-kernel@vger.kernel.org, kuznet@ms2.inr.ac.ru,
yoshfuji@linux-ipv6.org, jmorris@namei.org, kaber@trash.net,
netdev@vger.kernel.org
Subject: Re: [PATCH] net: ipconfig: fix ic_close_devs() use-after-free
Date: Mon, 27 Mar 2017 21:07:24 -0700 (PDT) [thread overview]
Message-ID: <20170327.210724.753199024787667111.davem@davemloft.net> (raw)
In-Reply-To: <1490634014-23098-1-git-send-email-mark.rutland@arm.com>
From: Mark Rutland <mark.rutland@arm.com>
Date: Mon, 27 Mar 2017 18:00:14 +0100
> Our chosen ic_dev may be anywhere in our list of ic_devs, and we may
> free it before attempting to close others. When we compare d->dev and
> ic_dev->dev, we're potentially dereferencing memory returned to the
> allocator. This causes KASAN to scream for each subsequent ic_dev we
> check.
>
> As there's a 1-1 mapping between ic_devs and netdevs, we can instead
> compare d and ic_dev directly, which implicitly handles the !ic_dev
> case, and avoids the use-after-free. The ic_dev pointer may be stale,
> but we will not dereference it.
>
> Original splat:
...
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Applied, thanks.
prev parent reply other threads:[~2017-03-28 4:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-27 17:00 [PATCH] net: ipconfig: fix ic_close_devs() use-after-free Mark Rutland
2017-03-28 4:07 ` 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=20170327.210724.753199024787667111.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.org \
/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).