[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250910170906.GD30363@horms.kernel.org>
Date: Wed, 10 Sep 2025 18:09:06 +0100
From: Simon Horman <horms@...nel.org>
To: Hangbin Liu <liuhangbin@...il.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
MD Danish Anwar <danishanwar@...com>,
Alexander Lobakin <aleksander.lobakin@...el.com>,
Jaakko Karrenpalo <jkarrenpalo@...il.com>,
Fernando Fernandez Mancera <ffmancera@...eup.net>,
Murali Karicheri <m-karicheri2@...com>,
WingMan Kwok <w-kwok2@...com>, Stanislav Fomichev <sdf@...ichev.me>,
Xiao Liang <shaw.leon@...il.com>,
Kuniyuki Iwashima <kuniyu@...gle.com>,
Johannes Berg <johannes.berg@...el.com>
Subject: Re: [PATCHv3 net 3/3] hsr: hold rcu and dev lock for
hsr_get_port_ndev
On Fri, Sep 05, 2025 at 09:15:33AM +0000, Hangbin Liu wrote:
> hsr_get_port_ndev calls hsr_for_each_port, which need to hold rcu lock.
> On the other hand, before return the port device, we need to hold the
> device reference to avoid UaF in the caller function.
>
> Suggested-by: Paolo Abeni <pabeni@...hat.com>
> Fixes: 9c10dd8eed74 ("net: hsr: Create and export hsr_get_port_ndev()")
> Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
Thanks.
I agree with your analysis.
And I see that this addresses Paolo's review over v2.
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists