Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1174382AbdDXUVw (ORCPT ); Mon, 24 Apr 2017 16:21:52 -0400 Received: from mail-io0-f174.google.com ([209.85.223.174]:35599 "EHLO mail-io0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1174367AbdDXUVp (ORCPT ); Mon, 24 Apr 2017 16:21:45 -0400 MIME-Version: 1.0 In-Reply-To: <20170424104853.k6s2jjmcdbbghit4@hirez.programming.kicks-ass.net> References: <20170421220939.GA65363@beast> <20170424104853.k6s2jjmcdbbghit4@hirez.programming.kicks-ass.net> From: Kees Cook Date: Mon, 24 Apr 2017 13:21:38 -0700 X-Google-Sender-Auth: DdSrhFlLocRrhaKNkCprnrgvqPo Message-ID: Subject: Re: [PATCH] x86/refcount: Implement fast refcount_t handling To: Peter Zijlstra Cc: LKML , Eric Biggers , Christoph Hellwig , "axboe@kernel.dk" , James Bottomley , Elena Reshetova , Hans Liljestrand , David Windsor , "x86@kernel.org" , Ingo Molnar , Arnd Bergmann , Greg Kroah-Hartman , Jann Horn , "David S. Miller" , linux-arch , "kernel-hardening@lists.openwall.com" , PaX Team Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 850 Lines: 28 On Mon, Apr 24, 2017 at 3:48 AM, Peter Zijlstra wrote: > On Fri, Apr 21, 2017 at 03:09:39PM -0700, Kees Cook wrote: >> diff --git a/drivers/misc/lkdtm_bugs.c b/drivers/misc/lkdtm_bugs.c >> index e3f4cd8876b5..1bdafb29b802 100644 >> --- a/drivers/misc/lkdtm_bugs.c >> +++ b/drivers/misc/lkdtm_bugs.c >> @@ -135,9 +135,15 @@ void lkdtm_HUNG_TASK(void) >> schedule(); >> } >> >> +#ifdef CONFIG_FAST_REFCOUNT >> +#define REFCOUNT_MAX INT_MAX >> +#else >> +#define REFCOUNT_MAX UINT_MAX >> +#endif > > That doesn't seem like a sensible place for this. I'll drop the LKDTM changes from this particular patch. As for the define, I think it's only interesting to LKDTM since it's the only part interested in refcount_t internals. (i.e. nothing else would (or should) use this information.) -Kees -- Kees Cook Pixel Security