From: "Lin Ma" <linma@zju.edu.cn>
To: "Matt Johnston" <matt@codeconstruct.com.au>
Cc: jk <jk@codeconstruct.com.au>, davem <davem@davemloft.net>,
kuba <kuba@kernel.org>, pabeni <pabeni@redhat.com>,
netdev <netdev@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v0] mctp: fix netdev reference bug
Date: Thu, 24 Mar 2022 11:26:03 +0800 (GMT+08:00) [thread overview]
Message-ID: <48d1c4f9.13e3e.17fb9f5bc59.Coremail.linma@zju.edu.cn> (raw)
Hi Matt,
Oops, sorry for the false alarm, I found this on mainline kernel and I should checkout net-next before sending the patch.
Regards
>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 reply other threads:[~2022-03-24 3:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 3:26 Lin Ma [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-03-24 2:39 Lin Ma
2022-03-24 3:17 ` Matt Johnston
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=48d1c4f9.13e3e.17fb9f5bc59.Coremail.linma@zju.edu.cn \
--to=linma@zju.edu.cn \
--cc=davem@davemloft.net \
--cc=jk@codeconstruct.com.au \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@codeconstruct.com.au \
--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®