Re: [PATCH] module: print module name on refcount error

From: Michal Hocko
Date: Thu Sep 14 2023 - 15:40:04 EST


On Mon 28-08-23 14:18:30, Jean Delvare wrote:
[...]
> > > It would likely be better to use refcount_t instead of atomic_t.
> >
> > Patches welcomed.
>
> Michal, do I understand correctly that this would prevent the case our
> customer had (too many gets), but won't make a difference for actual
> too-many-puts situations?


yes, refcount_t cannot protect from too-many-puts because there is not
real way to protect from those AFAICS. At a certain moment you just drop
to 0 and lose your object and all following that is a UAF. But I do not
think this is actually the interesting case at all.
--
Michal Hocko
SUSE Labs