lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y8mlbKZK3aFA/sAH@pop-os.localdomain>
Date:   Thu, 19 Jan 2023 12:17:48 -0800
From:   Cong Wang <xiyou.wangcong@...il.com>
To:     Paolo Abeni <pabeni@...hat.com>
Cc:     Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net,
        netdev@...r.kernel.org, edumazet@...gle.com,
        Linux Kernel Functional Testing <lkft@...aro.org>,
        jhs@...atatu.com, jiri@...nulli.us, john.hurley@...ronome.com
Subject: Re: [PATCH net] net: sched: gred: prevent races when adding offloads
 to stats

On Tue, Jan 17, 2023 at 10:00:56AM +0100, Paolo Abeni wrote:
> Hello,
> 
> On Sat, 2023-01-14 at 18:20 -0800, Cong Wang wrote:
> > On Thu, Jan 12, 2023 at 08:41:37PM -0800, Jakub Kicinski wrote:
> > > Naresh reports seeing a warning that gred is calling
> > > u64_stats_update_begin() with preemption enabled.
> > > Arnd points out it's coming from _bstats_update().
> > 
> > 
> > The stack trace looks confusing to me without further decoding.
> > 
> > Are you sure we use sch->qstats/bstats in __dev_queue_xmit() there
> > not any netdev stats? It may be a false positive one as they may end up
> > with the same lockdep class.
> 
> I'm unsure I read you comment correctly. Please note that the
> referenced message includes several splats. The first one - arguably
> the most relevant - points to the lack of locking in the gred control
> path.

I think it means lack of BH disable, not necessarily locking.

> 
> The posted patch LGTM, could you please re-phrase your doubts?

Yes, because the key in lockdep ("&syncp->seq#14") may be same for other
dev stats (aka, not qdisc stats).

Also, HTB does not accquire this lock when dumping
(htb_dump_class_stats()) stats. Why don't we have a problem there? ;)

Thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ