Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161111193947.GA4457@arm.com>
Date: Fri, 11 Nov 2016 19:39:47 +0000
From: Will Deacon <will.deacon@....com>
To: Mark Rutland <mark.rutland@....com>
Cc: kernel-hardening@...ts.openwall.com, Kees Cook <keescook@...omium.org>,
	Greg KH <gregkh@...uxfoundation.org>,
	David Windsor <dave@...gbits.org>,
	Elena Reshetova <elena.reshetova@...el.com>,
	Arnd Bergmann <arnd@...db.de>, Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <h.peter.anvin@...el.com>
Subject: Re: Re: [RFC v4 PATCH 00/13] HARDENED_ATOMIC

On Fri, Nov 11, 2016 at 06:47:44PM +0000, Mark Rutland wrote:
> On Fri, Nov 11, 2016 at 06:46:30PM +0100, Peter Zijlstra wrote:
> > On Fri, Nov 11, 2016 at 09:43:00AM -0800, Kees Cook wrote:
> > > > 1) kref: Used for honest-to-goodness reference counters that want
> > > > overflow protection.  Uses a new type: atomic_nowrap_t that has
> > > > HARDENED_ATOMIC protection.
> > > 
> > > Based on other feedback, it sounds like we're better off with
> > > refcount_t (which kref could be implemented on top of). And refcount_t
> > > would have a limited API: inc, dec_and_test (or whatever is determined
> > > as sanely minimal).
> > > 
> > > > 2) statistical counters: Atomic in all cases, but wraps.
> > > 
> > > Yup. sequence_t seems to make the most sense on naming, I think. If we
> > > want to get crazy, the type could be sequence_wrap_t.
> > 
> > Why? atomic_t is still perfectly fine here, right?
> 
> Having a name that clearly highlights the intended use-case makes it
> much more obvious what the expected semantics are, and when it is being
> abused. If atomic_t were rarely used directly, bad uses are less likely
> to get cargo-culted into new code.

So what? Now somebody with a driver using atomic_t just does
s/atomic_t/sequence_t/. The rename gains us nothing but churn. Whether this
is opt-in or opt-out, somebody *still* has to audit every single use, in
existing code and new code. Doing that audit after a tree-wide rename
doesn't help a bit.

Will

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.