Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp433289rdg; Tue, 10 Oct 2023 15:04:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvQN0/gni6D6oqFbXpVZR65dFLQ7CvCeaXoVqsczfsvxUpcLfYkShBVUAryXeQXUwmACn4 X-Received: by 2002:a05:6358:2904:b0:141:bfc:b11d with SMTP id y4-20020a056358290400b001410bfcb11dmr20100657rwb.16.1696975484835; Tue, 10 Oct 2023 15:04:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696975484; cv=none; d=google.com; s=arc-20160816; b=uWpRheO44quMLPtHGLVCXIfL+iNESkciNavaaUxAMwxU6MJb6tqMdqE4G6mhp3vEBQ J4UjS4/ApAUlt/yQM3heVcWnPbT3vk6Bp0oocj8H+/9LBdKfCwM7A5J6iJemrZvL4xYQ Gq0KqE1Qs8ypBrBA0YkVYnLB1Ym3AMAULbiuYHFNRcTjZtku305i/htSa0p8Oci/syS2 KBDC7j0yI9wds0zyaT5RDk4IhjUQaTUaTFGB/a092XzbLjKP0Edo0q+nLwg0mx4VJ50Y C77zUnT899KMuzifyT5hLaXgeMnFAorwHgmN9NsTlbRKqB1blfuRKJK+QDbnWEV0YJH3 obrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=b/9Sso2alxhsb0I75/YmVzI4zCmw+dUkaR4lEvo/XEU=; fh=5E4dng1Qch5g8X9pbgYtMDRXF3VlJsTD5h6q+K3t/4c=; b=odO8qcUhH8JXQkS1p06gl18DB4LuVS0ImzC6D2Pg0ZYTTZlNyPIgInFVt+QFk9KvDv YHhrbTBGxWYk9l/WH8Ntj63Pmx3peZZVSrIj3nVgCd8r5oNujfynEfcb5ZJfROaq6Xsh RI2n/v1OySkFhgz9V2jz7V3K4qL7I9h7dZbT5D+Vm0Y09UE3HT7mkvNxkfdIYdDAfNHn 5NR9SYsbzVfkStq1rVQuj+QO2pbE65gutVoS497weswjo2wJLFcotsVxryufk3ZT5nLU EtQajWMiGKbgkHisGyVDOQYrhS0WcQZ6fnvg6YXSyANr2uOxB6mE2wX3nHJBo9wwSxTX 1AKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Vn0PBfL+; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id y193-20020a638aca000000b0057851fc2b4asi10346315pgd.55.2023.10.10.15.04.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 15:04:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Vn0PBfL+; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id DFA3D8042AAD; Tue, 10 Oct 2023 15:04:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229778AbjJJWEO (ORCPT + 99 others); Tue, 10 Oct 2023 18:04:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbjJJWEN (ORCPT ); Tue, 10 Oct 2023 18:04:13 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF26C98; Tue, 10 Oct 2023 15:04:11 -0700 (PDT) Date: Tue, 10 Oct 2023 22:04:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696975450; h=from:from:sender:sender:reply-to: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; bh=b/9Sso2alxhsb0I75/YmVzI4zCmw+dUkaR4lEvo/XEU=; b=Vn0PBfL+YE2HoK+kf5JJ38nxe6DUwGKUUM4+2XPmn1C+0sB4YHFP+KbBGCDlWA6wnvEEHD hiMSWkKgomRpbZDpXxQtEAuCJhO/0Yg2LuXj+kFVOTEAaichDp1XYwVQXNNQGKhsUlYc4F 6HLArONryo2BJchVj6Zb5b4VVLkKxisNuhlLmdLQzBFHvb7XJG7IHfGpkfxuyVOgF/7DIm yXoYR4XMnDmz9IYJg++LmwpQ/HKKpasBTR8MvNhqz4aWAZSk9/8BcMuN9FMfk4YiJZD2Bp d2eUk0DJieOcaRG4aw56kfTISX+U9lSbP2ibohU+QksC33ictZYwcRVgv8mahw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696975450; h=from:from:sender:sender:reply-to: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; bh=b/9Sso2alxhsb0I75/YmVzI4zCmw+dUkaR4lEvo/XEU=; b=g/4XYwMeRhbzqu/smi6nubCAnhTy4cv3A2z8PywVtN7+shujPsPc63XYs1YWRkAO/UW6VP npKeEwntNJpe2WBw== From: "tip-bot2 for Uros Bizjak" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/percpu] x86/percpu: Disable named address spaces for KASAN Cc: kernel test robot , Uros Bizjak , Ingo Molnar , Andy Lutomirski , Brian Gerst , Denys Vlasenko , "H. Peter Anvin" , Linus Torvalds , Peter Zijlstra , Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231009151409.53656-1-ubizjak@gmail.com> References: <20231009151409.53656-1-ubizjak@gmail.com> MIME-Version: 1.0 Message-ID: <169697544974.3135.4822379707412006238.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Tue, 10 Oct 2023 15:04:42 -0700 (PDT) X-Spam-Level: ** The following commit has been merged into the x86/percpu branch of tip: Commit-ID: e29aad08b1da7772b362537be32335c0394e65fe Gitweb: https://git.kernel.org/tip/e29aad08b1da7772b362537be32335c0394e65fe Author: Uros Bizjak AuthorDate: Mon, 09 Oct 2023 17:13:48 +02:00 Committer: Ingo Molnar CommitterDate: Tue, 10 Oct 2023 23:57:35 +02:00 x86/percpu: Disable named address spaces for KASAN -fsanitize=kernel-address (KASAN) is at the moment incompatible with named address spaces - see GCC PR sanitizer/111736: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111736 GCC is doing a KASAN check on a percpu address which it shouldn't do, and didn't used to do because we did the access using inline asm. But now that GCC does the accesses as normal (albeit special address space) memory accesses, the KASAN code triggers on them too, and it all goes to hell in a handbasket very quickly. Those percpu accessor functions need to disable any KASAN checking or other sanitizer checking. Not on the percpu address, because that's not a "real" address, it's obviously just the offset from the segment register. And GCC should probably not have generated such code in the first place, so arguably this is a bug with -fsanitize=kernel-address. The patch also removes a stale dependency on CONFIG_SMP. Reported-by: kernel test robot Signed-off-by: Uros Bizjak Signed-off-by: Ingo Molnar Cc: Andy Lutomirski Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Josh Poimboeuf Link: https://lore.kernel.org/r/20231009151409.53656-1-ubizjak@gmail.com Closes: https://lore.kernel.org/oe-lkp/202310071301.a5113890-oliver.sang@intel.com --- arch/x86/Kconfig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index ecb2569..54e79d3 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -2393,7 +2393,12 @@ config CC_HAS_NAMED_AS config USE_X86_SEG_SUPPORT def_bool y - depends on CC_HAS_NAMED_AS && SMP + depends on CC_HAS_NAMED_AS + # + # -fsanitize=kernel-address (KASAN) is at the moment incompatible + # with named address spaces - see GCC PR sanitizer/111736. + # + depends on !KASAN config CC_HAS_SLS def_bool $(cc-option,-mharden-sls=all)