From: Matt Johnston <matt@codeconstruct.com.au>
To: Lin Ma <linma@zju.edu.cn>,
jk@codeconstruct.com.au, davem@davemloft.net, kuba@kernel.org,
pabeni@redhat.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v0] mctp: fix netdev reference bug
Date: Thu, 24 Mar 2022 11:17:56 +0800 [thread overview]
Message-ID: <61ac01e70c293b7e0d378436f7617daaad552fcf.camel@codeconstruct.com.au> (raw)
In-Reply-To: <20220324023904.7173-1-linma@zju.edu.cn>
Hi Lin Ma,
On Thu, 2022-03-24 at 10:39 +0800, Lin Ma wrote:
> In extended addressing mode, function mctp_local_output() fetch netdev
> through dev_get_by_index_rcu, which won't increase netdev's reference
> counter. Hence, the reference may underflow when mctp_local_output calls
> dev_put(), results in possible use after free.
>
> This patch adds dev_hold() to fix the reference bug.
This was already fixed in net-next to increment the refcount in
__mctp_dev_get() and use mctp_dev_put().
dc121c008491 ("mctp: make __mctp_dev_get() take a refcount hold")
e297db3eadd7 ("mctp: Fix incorrect netdev unref for extended addr")
Thanks,
Matt
next prev parent reply other threads:[~2022-03-24 3:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 2:39 Lin Ma
2022-03-24 3:17 ` Matt Johnston [this message]
2022-03-24 3:26 Lin Ma
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=61ac01e70c293b7e0d378436f7617daaad552fcf.camel@codeconstruct.com.au \
--to=matt@codeconstruct.com.au \
--cc=davem@davemloft.net \
--cc=jk@codeconstruct.com.au \
--cc=kuba@kernel.org \
--cc=linma@zju.edu.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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
all inboxes | Powered by JetHome®