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: <20220822183205.19735-1-kuniyu@amazon.com>
Date:   Mon, 22 Aug 2022 11:32:05 -0700
From:   Kuniyuki Iwashima <kuniyu@...zon.com>
To:     <kuba@...nel.org>
CC:     <davem@...emloft.net>, <edumazet@...gle.com>, <kuni1840@...il.com>,
        <kuniyu@...zon.com>, <netdev@...r.kernel.org>, <pabeni@...hat.com>
Subject: Re: [PATCH v3 net 05/17] ratelimit: Fix data-races in ___ratelimit().

From:   Jakub Kicinski <kuba@...nel.org>
Date:   Fri, 19 Aug 2022 17:04:46 -0700
> On Thu, 18 Aug 2022 11:26:41 -0700 Kuniyuki Iwashima wrote:
> > +	int interval = READ_ONCE(rs->interval);
> > +	int burst = READ_ONCE(rs->burst);
> 
> Also feels a little bit like papering over an issue if we read 
> two values separately.

Exactly, we have to protect it with a single lock.
Considering ___ratelimit() can be called in many paths, it seems better
to add a spin lock in struct ratelimit_state.

Thank you.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ