Re: [PATCH 5/5] fs: Convert struct file::f_count to refcount_long_t

From: Al Viro
Date: Thu May 02 2024 - 18:43:08 EST


On Thu, May 02, 2024 at 03:33:40PM -0700, Kees Cook wrote:
> Underflow of f_count needs to be more carefully detected than it
> currently is. The results of get_file() should be checked, but the
> first step is detection. Redefine f_count from atomic_long_t to
> refcount_long_t.

It is used on fairly hot paths. What's more, it's not
at all obvious what the hell would right semantics be.

NAKed-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>