From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx.tkos.co.il (guitar.tcltek.co.il [192.115.133.116]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rlmXm5jk8zDr1l for ; Fri, 8 Jul 2016 04:36:07 +1000 (AEST) Date: Thu, 7 Jul 2016 21:35:59 +0300 From: Baruch Siach To: Kees Cook Cc: LKML , Jan Kara , "kernel-hardening@lists.openwall.com" , Catalin Marinas , Will Deacon , Linux-MM , sparclinux , linux-ia64@vger.kernel.org, Christoph Lameter , Andrea Arcangeli , linux-arch , Michael Ellerman , "x86@kernel.org" , Russell King , "linux-arm-kernel@lists.infradead.org" , Benjamin Herrenschmidt , PaX Team , Borislav Petkov , Mathias Krause , Fenghua Yu , Rik van Riel , Vitaly Wool , David Rientjes , Tony Luck , Andy Lutomirski , Joonsoo Kim , Dmitry Vyukov , Laura Abbott , Brad Spengler , Ard Biesheuvel , Pekka Enberg , Casey Schaufler , Andrew Morton , "linuxppc-dev@lists.ozlabs.org" , "David S. Miller" Subject: Re: [PATCH 1/9] mm: Hardened usercopy Message-ID: <20160707183559.GR2118@tarshish> References: <1467843928-29351-1-git-send-email-keescook@chromium.org> <1467843928-29351-2-git-send-email-keescook@chromium.org> <20160707053710.GH2118@tarshish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hi Kees, On Thu, Jul 07, 2016 at 01:25:21PM -0400, Kees Cook wrote: > On Thu, Jul 7, 2016 at 1:37 AM, Baruch Siach wrote: > > On Wed, Jul 06, 2016 at 03:25:20PM -0700, Kees Cook wrote: > >> +#ifdef CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR > > > > Should be CONFIG_HARDENED_USERCOPY to match the slab/slub implementation > > condition. > > > >> +const char *__check_heap_object(const void *ptr, unsigned long n, > >> + struct page *page); > >> +#else > >> +static inline const char *__check_heap_object(const void *ptr, > >> + unsigned long n, > >> + struct page *page) > >> +{ > >> + return NULL; > >> +} > >> +#endif > > Hmm, I think what I have is correct: if the allocator supports the > heap object checking, it defines __check_heap_object as existing via > CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR. If usercopy checking is done > at all is controlled by CONFIG_HARDENED_USERCOPY. > > I.e. you can have the other usercopy checks even if your allocator > doesn't support object size checking. Right. I missed the fact that usercopy.c build also depends on CONFIG_HARDENED_USERCOPY. Sorry for the noise. baruch -- http://baruch.siach.name/blog/ ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -