From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 673FAECAAD5 for ; Sat, 27 Aug 2022 04:17:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B0CDC6B0073; Sat, 27 Aug 2022 00:17:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ABB426B0074; Sat, 27 Aug 2022 00:17:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 982E0940007; Sat, 27 Aug 2022 00:17:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 88F0D6B0073 for ; Sat, 27 Aug 2022 00:17:33 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 573EBC059F for ; Sat, 27 Aug 2022 04:17:33 +0000 (UTC) X-FDA: 79844063586.17.B28CF73 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf20.hostedemail.com (Postfix) with ESMTP id E42851C0029 for ; Sat, 27 Aug 2022 04:17:32 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E7BBE60A2C; Sat, 27 Aug 2022 04:17:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 299E8C433D6; Sat, 27 Aug 2022 04:17:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1661573851; bh=6Iz/eGwmp2OnF5aKahMz1qTW0tTKm7mlFOFhFDxX1AA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=0wwPwPqYjbGm6Ce5o/Y1H+DJmaTo4tbspFfmRDrZEp4vlLxYw57ALtc0CXFnvMbGh VFCSnWNxDc7JkINYWGfzPhl/loGQPXhQADf4HucY5q1H3K85IqB7J0Fx6rs5x3gQei vqaTpKDnySwwiXOltZ9lClnMZEmM8Ob5p56kBsi0= Date: Fri, 26 Aug 2022 21:17:29 -0700 From: Andrew Morton To: Alexander Potapenko Cc: Alexander Viro , Alexei Starovoitov , Andrey Konovalov , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Marco Elver , Mark Rutland , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 04/44] x86: asm: instrument usercopy in get_user() and put_user() Message-Id: <20220826211729.e65d52e7919fee5c34d22efc@linux-foundation.org> In-Reply-To: <20220826150807.723137-5-glider@google.com> References: <20220826150807.723137-1-glider@google.com> <20220826150807.723137-5-glider@google.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661573853; a=rsa-sha256; cv=none; b=IpYXQq2FtRuKkIugCAhaxc/XoEqpuzem3PUsTKQw9OuRGcFcGYZAnW51pgSaZHCtsWSzTp /FSG+wNpm5U4a1Z3VpWBJPTxGVNtiboUekE5mNtCUInCP57dfABaAzXVHTwpA0QjXfbDfV mMQLvUyzkto8iiNIxU77nXuFKioEKRQ= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=0wwPwPqY; dmarc=none; spf=pass (imf20.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661573853; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=YXKY7xUH+e8MljL5ktdAuQHuT8m/c8UeQSkKo/fZ3pM=; b=W0UmmL/pFDmTUHlTV8l8smcc0d4Wpa6AmY0ObIYVll4QDj+FdwqxOuavEhZ+bZ4MLn17Oh hO6fbxTBp95uhGzMLta/p8zhJ7tibgngqfr6o6Yl1ghzSHV9XlbWJStIg9a1xaISa8q6UW pI+Gp7Z7WxL3mpHboJF2DjKNxSgEN1Y= X-Rspamd-Queue-Id: E42851C0029 Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=0wwPwPqY; dmarc=none; spf=pass (imf20.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspam-User: X-Rspamd-Server: rspam01 X-Stat-Signature: 7auahj9monpudcp6djioaufksshwed9t X-HE-Tag: 1661573852-382073 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, 26 Aug 2022 17:07:27 +0200 Alexander Potapenko wrote: > Use hooks from instrumented.h to notify bug detection tools about > usercopy events in variations of get_user() and put_user(). And this one blows up x86_64 allmodconfig builds. > --- a/arch/x86/include/asm/uaccess.h > +++ b/arch/x86/include/asm/uaccess.h > @@ -5,6 +5,7 @@ > * User space memory access functions > */ > #include > +#include > #include > #include > #include instrumented.h looks like a higher-level thing than uaccess.h, so this inclusion is an inappropriate layering. Or maybe not. In file included from ./include/linux/kernel.h:22, from ./arch/x86/include/asm/percpu.h:27, from ./arch/x86/include/asm/nospec-branch.h:14, from ./arch/x86/include/asm/paravirt_types.h:40, from ./arch/x86/include/asm/ptrace.h:97, from ./arch/x86/include/asm/math_emu.h:5, from ./arch/x86/include/asm/processor.h:13, from ./arch/x86/include/asm/timex.h:5, from ./include/linux/timex.h:67, from ./include/linux/time32.h:13, from ./include/linux/time.h:60, from ./include/linux/stat.h:19, from ./include/linux/module.h:13, from init/do_mounts.c:2: ./include/linux/page-flags.h: In function 'page_fixed_fake_head': ./include/linux/page-flags.h:226:36: error: invalid use of undefined type 'const struct page' 226 | test_bit(PG_head, &page->flags)) { | ^~ [25000 lines snipped] And kmsan-add-kmsan-runtime-core.patch introduces additional build errors with x86_64 allmodconfig. This is all with CONFIG_KMSAN=n I'll disable the patch series. Please do much more compilation testing - multiple architectures, allnoconfig, allmodconfig, allyesconfig, defconfig, randconfig, etc. Good luck, it looks ugly :(