Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1302177rdb; Mon, 2 Oct 2023 05:49:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHs+LYARxa5/553kLsK1vyzxOe4Zk998n4FzYOwqPoEgG49+cZK0xv3l913Pt1XPcGBVnoP X-Received: by 2002:a05:6871:14a:b0:1d6:56d8:a788 with SMTP id z10-20020a056871014a00b001d656d8a788mr14539843oab.40.1696250949534; Mon, 02 Oct 2023 05:49:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696250949; cv=none; d=google.com; s=arc-20160816; b=C7jON0dw4XxuQKWlP4Bp/IOUMr/rEmRJfVLyoL5TN3rq9W+l+NJJHeMwuSIngq/s1f 4+L+EAtNQVxI3J9yp0JL6r/tCS0G6Q9vjTZozeq62qlBQ8dRg3EcgDKwY45q/QI9QJs6 vhpyBsLaqj96HS4O1qorPYgAkxTnv5R6JuWiZUann8fzMmhB2jqLgxz2Vbohd1gzENTh GEZsiZ9H08x2AGpW27XIr1ANyytd10DzwiPqvi1UdnzBu2Gr0wNBiu7e1OKvUQyXULjx 9pnaF93p/70ipVgtxytJMKa277B+WA8bKSjoG1HLGUHTJj519TASZIAqNZ3aQxprc2qY zKKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AA7nmoAyLF0A+oeQqQnncAoTAl+IjCg4AvOPjPTKPFw=; fh=HoNV758uGVreKnoatk7TOn0lRb5fnpj7vxs7KIdP1jA=; b=DAAPhJHi4mNeZaY3zUD2LIpYUnOr6Y4pSyMhVEsnIZxHVuL+9MllnObN++hy0fP+Lj bCbL05+vqVeEtNRONdgW7WDL6ipWEUlNLQ+ZYoI6lH/RnECU7aONevz+aIuJP9plvdYq H+K2VlArpuFqbrJv2X2qKaqaPXrI7qYmO07CYWFWyh+ZZbzohjgHjVpFlNOEj0gSiZjz /LMW6FsMsByXMB1Er+hbpdg5Jrd+3XjTgv6SvbjyCbdFLoPmsNPwexA2gWp2U8EFvuh+ l/wddHpBsoX+GeWLW0ywJ4bB/fo2YKTwkIuUW9g6jqnAihB+yadPBXa/weHfj/ME24/y 5zPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=eizFjP6h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id l70-20020a639149000000b00585a16c102dsi7533091pge.39.2023.10.02.05.49.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 05:49:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=eizFjP6h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id EADFB807158B; Mon, 2 Oct 2023 03:41:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236542AbjJBKlP (ORCPT + 99 others); Mon, 2 Oct 2023 06:41:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236537AbjJBKlO (ORCPT ); Mon, 2 Oct 2023 06:41:14 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFEDEAB for ; Mon, 2 Oct 2023 03:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=AA7nmoAyLF0A+oeQqQnncAoTAl+IjCg4AvOPjPTKPFw=; b=eizFjP6hx1bHEnv2zyaIlMtBCJ m1yIhYfxkc1ZwEbvPUjdNY643PA3OhC8ZTz4fEv+GKC8PkCDThtDkPC6it+ZtFBS7p7CC4Z/LOQII 094JDhaX3AesiiyQ68aVL1I6hqV4TmkSNNWkDfBwtKPbwaa7ZIdK99chTtmfjUbpSvZiG5cggDrI2 FFJWcqzl3m/Epu9Davcl8YwAuC/vzIX44RsxKb4UkZqqO2/tcfGwlD6a3Z6XH3skw4h+Yl/V+LmP+ WGlDmgTF+alnPdFhsHw/9rtpxsvxj/BDfPmhL8EhsqPjdpkcC/waHo/bd7zd/ZgodvEI1qtgsHvcd Rbem96TQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qnGMC-008bhu-Oq; Mon, 02 Oct 2023 10:40:57 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 7194A30036C; Mon, 2 Oct 2023 12:40:56 +0200 (CEST) Date: Mon, 2 Oct 2023 12:40:56 +0200 From: Peter Zijlstra To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: Linus Torvalds , Linux Kernel Mailing List , David Kaplan , Borislav Petkov , Ingo Molnar , x86@kernel.org Subject: Re: Linux 6.6-rc3 (DEBUG_VIRTUAL is unhappy on x86) Message-ID: <20231002104056.GA13957@noisy.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 02 Oct 2023 03:41:27 -0700 (PDT) On Sun, Oct 01, 2023 at 11:17:21PM +0900, Hyeonggon Yoo wrote: > OK, I looked into this a little bit, and it turns out that the problematic > address here is from cleanup_trusted() in > security/keys/trusted-keys/trusted_core.c. > (and it's builtin due to CONFIG_TRUSTED_KEYS=y) That code is insane.. wth would you want to use an explicit static_call() in either __init or __exit ?!? I think the reason we support init was because it was just really hard to avoid throughout the abstraction layers etc.. But this seems to be the only __exit user, and it is really quite daft. > The function is marked as __exit, so it does not fall within the > 'core kernel text address range,' which is between _stext and _etext > (or between _sinittext and _einittext). and thus __text_poke() thinks that > it's vmalloc/module area. > > I think __text_poke() should be taught that functions marked as __exit > also belong to kernel code just like __init. Should we not do something like: #ifdef MODULE #define __exit __section(".exit.text") __exitused __cold notrace #else #define __exit __section(".discard.exit.text") #endif It's not like that code should ever be ran or referenced when built-in.