From mboxrd@z Thu Jan 1 00:00:00 1970 Reply-To: kernel-hardening@lists.openwall.com Date: Wed, 16 Nov 2016 18:32:43 +0100 From: Peter Zijlstra Message-ID: <20161116173243.GX3142@twins.programming.kicks-ass.net> References: <20161110233835.GA23164@kroah.com> <20161111174630.GO3117@twins.programming.kicks-ass.net> <20161111201704.GQ3117@twins.programming.kicks-ass.net> <1479228602.4622.64.camel@redhat.com> <1479316156.21171.30.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1479316156.21171.30.camel@redhat.com> Subject: Re: [kernel-hardening] Re: [RFC v4 PATCH 00/13] HARDENED_ATOMIC To: Rik van Riel Cc: kernel-hardening@lists.openwall.com, Will Deacon , Greg KH , David Windsor , Elena Reshetova , Arnd Bergmann , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" List-ID: On Wed, Nov 16, 2016 at 12:09:16PM -0500, Rik van Riel wrote: > On Tue, 2016-11-15 at 09:23 -0800, Kees Cook wrote: > > Right, but it's the continuing atomic_t use that concerns me... > > Can we remove inc_not_zero and dec_and_test functionality > from the atomic_t macros? > > It would require fixing all of the in tree code, and after > that people with out of tree code would have to switch to > refcount_t to make their code work again. People will just use (atomic_add_return(-1, &refcount) == 0) instead, or any other variant along those lines. And the inc_not_zero() users are typically more advanced, since that almost always implies them using RCU.