Re: [PATCH 0/3] Convert nsproxy, groups, and creds to refcount_t

From: David Howells
Date: Tue Jul 21 2020 - 06:51:16 EST


Kees Cook <keescook@xxxxxxxxxxxx> wrote:

> > Should mm->mm_users also be replaced by refcount_t?
>
> I'll say "yes". :)
> https://lore.kernel.org/lkml/1487671124-11188-1-git-send-email-elena.reshetova@xxxxxxxxx/
>
> > In addition, is it better to change all variables that use
> > atomic_dec_and_test to control the release process to refconut_t?
>
> For the most part, yes. The following may find a lot of them:
> scripts/coccinelle/api/atomic_as_refcounter.cocci

I've been gradually undoing some of the conversions as there's no equivalent
of atomic_add_return() and atomic_dec_return() that allow me to log the
altered refcount through a tracepoint.

David