Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 11 Nov 2016 18:46:30 +0100
From: Peter Zijlstra <>
To: Kees Cook <>
Cc: Will Deacon <>, Greg KH <>,
	David Windsor <>,
	"" <>,
	Elena Reshetova <>,
	Arnd Bergmann <>, Thomas Gleixner <>,
	Ingo Molnar <>,
	"H. Peter Anvin" <>
Subject: Re: Re: [RFC v4 PATCH 00/13] HARDENED_ATOMIC

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?

> > 3) atomic_t: All other users of atomics (locks, etc.).  Wrapping
> > behavior depends on a CONFIG setting.
> Correct: if CONFIG_PARANOID_ATOMIC (or something) is set, atomic_t is
> implemented as refcount_t, otherwise as sequence_t.

Can't happen. There is far more atomic_t usage than reference and/or
statistics counters.

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.