Re: [PATCH 1/4] fs, afs: convert afs_cell.usage from atomic_t to refcount_t
From: David Howells
Date: Fri Feb 24 2017 - 09:29:41 EST
Kees Cook <keescook@xxxxxxxxxxxx> wrote:
> We can't allow the increment from 0 since it violates the intended
> use-after-free protections.
I would have thought that the protections would've been against the carry flag
getting set.
> If "0" means "still valid" then this
> sounds like it needs a global +1, as Elena suggested in her reply.
This makes it sound like refcount_t is then unsuitable for this.
Since I want to overhaul the code to use more RCU and eliminate some of the
locking, it might be worth waiting on the patches.
David