Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 15 Mar 2021 15:19:17 -0700
From: Linus Torvalds <>
To: Kees Cook <>
Cc: Alexey Gladkov <>, LKML <>, 
	io-uring <>, 
	Kernel Hardening <>, 
	Linux Containers <>, Linux-MM <>, 
	Alexey Gladkov <>, Andrew Morton <>, 
	Christian Brauner <>, "Eric W . Biederman" <>, 
	Jann Horn <>, Jens Axboe <>, Oleg Nesterov <>
Subject: Re: [PATCH v8 3/8] Use atomic_t for ucounts reference counting

On Mon, Mar 15, 2021 at 3:03 PM Kees Cook <> wrote:
> On Wed, Mar 10, 2021 at 01:01:28PM +0100, Alexey Gladkov wrote:
> > The current implementation of the ucounts reference counter requires the
> > use of spin_lock. We're going to use get_ucounts() in more performance
> > critical areas like a handling of RLIMIT_SIGPENDING.
> This really looks like it should be refcount_t.


refcount_t didn't have the capabilities required.

It just saturates, and doesn't have the "don't do this" case, which
the ucounts case *DOES* have.

In other words, refcount_t is entirely misdesigned for this - because
it's literally designed for "people can't handle overflow, so we warn
and saturate".

ucounts can never saturate, because they replace saturation with
"don't do that then".

In other words, ucounts work like the page counts do (which also don't
saturate, they just say "ok, you can't get a reference".

I know you are attached to refcounts, but really: they are not only


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.