[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240405195117.GV26556@kernel.org>
Date: Fri, 5 Apr 2024 20:51:17 +0100
From: Simon Horman <horms@...nel.org>
To: Petr Tesarik <petr@...arici.cz>
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
open list <netdev@...r.kernel.org>,
Linux regressions mailing list <regressions@...ts.linux.dev>,
open list <linux-kernel@...r.kernel.org>,
"Linux regression tracking (Thorsten Leemhuis)" <regressions@...mhuis.info>
Subject: Re: [PATCH net] u64_stats: fix u64_stats_init() for lockdep when
used repeatedly in one file
On Thu, Apr 04, 2024 at 09:57:40AM +0200, Petr Tesarik wrote:
> Fix bogus lockdep warnings if multiple u64_stats_sync variables are
> initialized in the same file.
>
> With CONFIG_LOCKDEP, seqcount_init() is a macro which declares:
>
> static struct lock_class_key __key;
>
> Since u64_stats_init() is a function (albeit an inline one), all calls
> within the same file end up using the same instance, effectively treating
> them all as a single lock-class.
>
> Fixes: 9464ca650008 ("net: make u64_stats_init() a function")
> Closes: https://lore.kernel.org/netdev/ea1567d9-ce66-45e6-8168-ac40a47d1821@roeck-us.net/
> Signed-off-by: Petr Tesarik <petr@...arici.cz>
Reviewed-by: Simon Horman <horms@...nel.org>
Interesting bug. I'm wondering if you also looked over other users of
u64_stats_init() to see if any of them can result in unexpected aliasing of
lock keys too.
..
Powered by blists - more mailing lists