Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753158AbeANU5z (ORCPT + 1 other); Sun, 14 Jan 2018 15:57:55 -0500 Received: from mail-vk0-f67.google.com ([209.85.213.67]:35990 "EHLO mail-vk0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752157AbeANU5w (ORCPT ); Sun, 14 Jan 2018 15:57:52 -0500 X-Google-Smtp-Source: ACJfBottzY1wEHHt2IC97Rnft7SISU+dMFxOihPf6De4ae5F7hk8OTigFZ3uD1kiyUW+i/AFZzRoc/U8DnmXh2MwdsI= MIME-Version: 1.0 In-Reply-To: References: <1515636190-24061-1-git-send-email-keescook@chromium.org> <1515636190-24061-3-git-send-email-keescook@chromium.org> From: Kees Cook Date: Sun, 14 Jan 2018 12:57:50 -0800 X-Google-Sender-Auth: TPeYCsLFH-Hic5i9ldT2VRDxEjQ Message-ID: Subject: Re: [PATCH 02/38] usercopy: Enhance and rename report_usercopy() To: Christopher Lameter Cc: LKML , Linus Torvalds , David Windsor , Alexander Viro , Andrew Morton , Andy Lutomirski , Christoph Hellwig , "David S. Miller" , Laura Abbott , Mark Rutland , "Martin K. Petersen" , Paolo Bonzini , Christian Borntraeger , Christoffer Dall , Dave Kleikamp , Jan Kara , Luis de Bethencourt , Marc Zyngier , Rik van Riel , Matthew Garrett , "linux-fsdevel@vger.kernel.org" , linux-arch , Network Development , Linux-MM , kernel-hardening@lists.openwall.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Thu, Jan 11, 2018 at 9:06 AM, Christopher Lameter wrote: > On Wed, 10 Jan 2018, Kees Cook wrote: > >> diff --git a/mm/slab.h b/mm/slab.h >> index ad657ffa44e5..7d29e69ac310 100644 >> --- a/mm/slab.h >> +++ b/mm/slab.h >> @@ -526,4 +526,10 @@ static inline int cache_random_seq_create(struct kmem_cache *cachep, >> static inline void cache_random_seq_destroy(struct kmem_cache *cachep) { } >> #endif /* CONFIG_SLAB_FREELIST_RANDOM */ >> >> +#ifdef CONFIG_HARDENED_USERCOPY >> +void __noreturn usercopy_abort(const char *name, const char *detail, >> + bool to_user, unsigned long offset, >> + unsigned long len); >> +#endif >> + >> #endif /* MM_SLAB_H */ > > This code has nothing to do with slab allocation. Move it into > include/linux/uaccess.h where the other user space access definitions are? Since it was only the mm/sl*b.c files using it, it seemed like the right place, but it's a reasonable point. I've moved it now. -Kees -- Kees Cook Pixel Security