lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 15 Nov 2016 10:47:44 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Ingo Molnar <mingo@...nel.org>
Cc:     gregkh@...uxfoundation.org, keescook@...omium.org,
        will.deacon@....com, elena.reshetova@...el.com, arnd@...db.de,
        tglx@...utronix.de, hpa@...or.com, dave@...gbits.org,
        linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH 7/7] kref: Implement using refcount_t

On Tue, Nov 15, 2016 at 09:40:09AM +0100, Ingo Molnar wrote:
> 
> * Peter Zijlstra <peterz@...radead.org> wrote:
> 
> > Provide refcount_t, an atomic_t like primitive built just for
> > refcounting.
> > 
> > It provides overflow and underflow checks as well as saturation
> > semantics such that when it overflows, we'll never attempt to free it
> > again, ever.
> > 
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> > ---
> >  include/linux/kref.h     |   29 ++----
> >  include/linux/refcount.h |  221 +++++++++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 232 insertions(+), 18 deletions(-)
> 
> I'd suggest splitting this patch into two parts: first patch introduces the 
> refcount.h facility, second patch changes over struct kref to the new facility.

You're right, I was just really glad I got it to compile and didn't want
to prod more at it.

Should I also make a CONFIG knob that implements refcount_t with the
'normal' atomic_t primitives?

And possibly another knob to toggle the BUG()s into WARN()s. With the
full saturation semantics WARN() is a lot safer and will not corrupt
kernel state as much.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ