[PATCH 1/4] fs, afs: convert afs_cell.usage from atomic_t to refcount_t

David Howells dhowells at redhat.com
Wed Feb 22 08:16:00 PST 2017


Elena Reshetova <elena.reshetova at intel.com> wrote:

> refcount_t type and corresponding API should be
> used instead of atomic_t when the variable is used as
> a reference counter. This allows to avoid accidental
> refcounter overflows that might lead to use-after-free
> situations.

This causes an assertion failure because cells aren't immediately destroyed
when their refcount reaches 0, but may be resurrected provided the cache lock
is held.  However, attempting to increment the 0 refcount does nothing, not
even giving a warning.

So please place a hold on this patch.  I will check the other AFS patches also.

David



More information about the linux-afs mailing list