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: <20250305021936.71e837ea@pumpkin>
Date: Wed, 5 Mar 2025 02:19:36 +0000
From: David Laight <david.laight.linux@...il.com>
To: Mateusz Guzik <mjguzik@...il.com>
Cc: brauner@...nel.org, viro@...iv.linux.org.uk, jack@...e.cz,
 linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [RFC PATCH v v2 0/4] avoid the extra atomic on a ref when
 closing a fd

On Tue,  4 Mar 2025 19:35:02 +0100
Mateusz Guzik <mjguzik@...il.com> wrote:

> The stock kernel transitioning the file to no refs held penalizes the
> caller with an extra atomic to block any increments.
> 
> For cases where the file is highly likely to be going away this is
> easily avoidable.

Have you looked at the problem caused by epoll() ?
The epoll code has a 'hidden' extra reference to the fd.
This doesn't usualy matter, but some of the driver callbacks add and
remove an extra reference - which doesn't work well if fput() has
just decremented it to zero.

The fput code might need to do a 'decrement not one' so that the
epoll tidyup can be done while the refcount is still one.

That would save the extra atomic pair that (IIRC) got added into
the epoll callback code.

Thoughts?

	David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ