Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3478151rwe; Mon, 29 Aug 2022 12:36:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR7JoJ/f60q/CxNCCJDkL9gcriJHoLmcgpeanToGpn81mwXSY9bPPWe85JWeQIPGf9+hsdnQ X-Received: by 2002:a17:906:b305:b0:742:1e04:998b with SMTP id n5-20020a170906b30500b007421e04998bmr401551ejz.571.1661801767719; Mon, 29 Aug 2022 12:36:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661801767; cv=none; d=google.com; s=arc-20160816; b=DDil8JWmPclpMdGY1fOCo4Cx0l4q5kKOeBnnK/3AATy27Y2F0r+aYVkI9wqxfQ5ICW T/deyCrgdL3tQKgD8ykaB+QnNa2ZgnfLs1YMuDqNiVksrOCVopG6QJGi82lCS2xFZWSP kVDcbqVR3i8xDSn2ExY5zK3Dfa0ivvMgTzNLV+Hdz4tKzHkIDvnkTNV8oQNybiPfgbv0 T/1R/xp65yO8icSm4jB+ablLlGE3SXihOP20jt0a+IkkKwJIotYCKI0335Qo9o/tl3Uh UvW2GsMgL7I7hrZUFwCactZrltekR3ewdVq1d+qwLaqCAvPKjfHrDwPjl0V9SB1zu/ZO 5TLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=/NTlFoZkG2bUm4RJ3DTKShJCWdzBXxO10ZwSGSS0Xho=; b=qGj+3saCRLQX1Us5fhbeYWUJbESdGnGqdBox/97HfzKymG0S6vOLos8F5p+uItK3cN tITHW78OwFrkwQwDDngHgAp5BQZDhmEMunWrC2Uhd+BsbNZmQ0g/w8n3DmKw/wu8Ni/O fKQf7f7JGteY8rph2Uf8htKgCzO00cWNTU586MjKQ6c278uwdVMuMwIHjRwqeIWkawg4 grDthNfMbPg9F2Joeysubu0VgEQOSQ8Pq8rBSEV6FeK0OlCzym2WZeINZkL7qrmY9yL0 KYYXu44feoLK2yCC5PIeAeTpwSLOI6ImTAcRMB/OZVZjzJgieRpq0MlDTtHUgJ5eFStv MpZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="e6GuB5/Z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk11-20020a1709077f8b00b007120a60b38asi7414952ejc.1001.2022.08.29.12.35.41; Mon, 29 Aug 2022 12:36:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="e6GuB5/Z"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229815AbiH2TZB (ORCPT + 99 others); Mon, 29 Aug 2022 15:25:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbiH2TY7 (ORCPT ); Mon, 29 Aug 2022 15:24:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32F091F2F1; Mon, 29 Aug 2022 12:24:56 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id 6F17EB811E9; Mon, 29 Aug 2022 19:24:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5E72C433D6; Mon, 29 Aug 2022 19:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1661801094; bh=bvJk1oFFNYzt8e4h6wKH6kqiTtNdEy8t/HVURp2TtOU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=e6GuB5/Z8vBgiihEDvt2dTWer1Mz4W1uoXySfQkHPdYVggcEMqrXENRWvhytKJ68N rOi3UokczdAHOoeSYIYDF+3pjSiCZjQZcIHCJEAM2IXlp4WL8aTnQ3QyeQD6GvYEeV LNm9hPATckMyEfH8R7ZRYofxbCOEfH2WK+fF02jo= Date: Mon, 29 Aug 2022 12:24:52 -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 , Linux Memory Management List , Linux-Arch , LKML Subject: Re: [PATCH v5 04/44] x86: asm: instrument usercopy in get_user() and put_user() Message-Id: <20220829122452.cce41f2754c4e063f3ae8b75@linux-foundation.org> In-Reply-To: References: <20220826150807.723137-1-glider@google.com> <20220826150807.723137-5-glider@google.com> <20220826211729.e65d52e7919fee5c34d22efc@linux-foundation.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 29 Aug 2022 16:57:31 +0200 Alexander Potapenko wrote: > On Sat, Aug 27, 2022 at 6:17 AM Andrew Morton wrote: > > > > 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. > > How do I reproduce this? > I tried running `make mrproper; make allmodconfig; make -j64` (or > allyesconfig, allnoconfig) on both KMSAN tree > (https://github.com/google/kmsan/commit/ac3859c02d7f40f59992737d63afcacda0a972ec, > which is Linux v6.0-rc2 plus the 44 KMSAN patches) and > linux-mm/mm-stable @ec6624452e36158d0813758d837f7a2263a4109d with > KMSAN patches applied on top of it. > All builds were successful. > > I then tried to cherry-pick just the first 4 commits to mm-stable and > see if allmodconfig works - it resulted in numerous "implicit > declaration of function ‘instrument_get_user’" errors (quite silly of > me), but nothing looking like the errors you posted. > I'll try to build-test every patch in the series after fixing the > missing declarations, but so far I don't see other problems. > > Could you share the mmotm commit id which resulted in the failures? I just pushed out a tree which exhibits this with gcc-12.1.1 and with gcc-11.1.0. Tag is mm-everything-2022-08-29-19-17. The problem is introduced by d0d9a44d2210 ("kmsan: add KMSAN runtime core") make mrproper make allmodconfig make init/do_mounts.o 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)) { | ^~ ./include/linux/bitops.h:50:44: note: in definition of macro ‘bitop’ 50 | __builtin_constant_p((uintptr_t)(addr) != (uintptr_t)NULL) && \ | ^~~~ ./include/linux/page-flags.h:226:13: note: in expansion of macro ‘test_bit’ 226 | test_bit(PG_head, &page->flags)) { | ^~~~~~~~ ...