[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <61ac01e70c293b7e0d378436f7617daaad552fcf.camel@codeconstruct.com.au>
Date: Thu, 24 Mar 2022 11:17:56 +0800
From: Matt Johnston <matt@...econstruct.com.au>
To: Lin Ma <linma@....edu.cn>, jk@...econstruct.com.au,
davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v0] mctp: fix netdev reference bug
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
Powered by blists - more mailing lists