Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1980794rdb; Mon, 9 Oct 2023 08:49:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHzLD860IhYMEUO+OobFjOA5Gn0/gGQQpSJ16u2gWxy48eAaV81PXAuMyspmXVVQ8vRCiCT X-Received: by 2002:a17:90a:ca8d:b0:26c:f9a5:4493 with SMTP id y13-20020a17090aca8d00b0026cf9a54493mr15459702pjt.5.1696866566554; Mon, 09 Oct 2023 08:49:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696866566; cv=none; d=google.com; s=arc-20160816; b=cp9Bofv5hoXvdUzOfFtLkRJNnWoNx/QTRz2lhR+t0JkFjImB9HEUbzURYQKApKVejd AapjjPWfttzN/IyT0sRroawel24zPZWIbyXx+qcobNaiZA8j4y7FSe2cOLVsyZpiA+hW UPc9sYV17EEHOX8iGASn6gw5LGp+KyjuQZInPaomS19gRzxr9nbG7fX6dvtwd3/a4zHR gciC2P+K3G/GYUNSKUfBS3HBtS1PxT//kCjJ1pRkRvkmBhyfTU2A6lRulHenq2M2y7pi 4r0BO6jgvIHMhXrB6lyZYMZImi5YfUNJVJOWThBjLjz1uCseGSIoRsUHDRC0OhTpOXpK XKAw== 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=X+oVfTqC76j1KleFzCRJpniXRpnWmOtaWGkOw3CLm40=; fh=qyt4o8bYxlZZyrIa2bjr/vaKg9XsMVBXpSW2fCbcD/s=; b=05NXfEFeYqXf8S+SPXc+LgvbuYl9WdafTp6RSplJjjb6FSRtC8whNPDPTC9yhDi7qQ sIUePAivxawzNJiQt4sNqhnatXj2q5Brkgj8lo7c2zkv5GP3cUfa7iTtVFY/TLGTBzk2 G/UoRukVQG8iFOzB5ege8BzjNSBsEIKeXP1/RPknDFh1kaZzrmNPM6FgJrIKPPOJkzyl mLBEgDgWDHGjzYp4kBYVRh5BPBbFHX2R5+y0FyoDYFyqZQqeRxRYyldqrPR9o02iqFdW vSrATip14hw3MXShJUkaD1vU8VwyD+TP8PEM4xup2eixsvCUsND0wtxLa/Wpjt3eZH7R fY3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=fWgVwznJ; dkim=neutral (no key) header.i=@linutronix.de header.b=hy+xM6zh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id a10-20020a17090ad80a00b00276b87c8b8esi9871408pjv.59.2023.10.09.08.49.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 08:49:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=fWgVwznJ; dkim=neutral (no key) header.i=@linutronix.de header.b=hy+xM6zh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id E35CD811138A; Mon, 9 Oct 2023 08:49:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377014AbjJIPsz (ORCPT + 99 others); Mon, 9 Oct 2023 11:48:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377008AbjJIPsw (ORCPT ); Mon, 9 Oct 2023 11:48:52 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B8979F; Mon, 9 Oct 2023 08:48:50 -0700 (PDT) Date: Mon, 09 Oct 2023 15:48:48 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1696866529; 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=X+oVfTqC76j1KleFzCRJpniXRpnWmOtaWGkOw3CLm40=; b=fWgVwznJNgeb84FfDdHd94HRXiUBq0xYEEt0oszfFWhUYRWaUgpDt2XWwWymndEwNn+9Ww 0A54jIrPgv1iY3w0VeIkT4ZyE3bcYf7tfNABXRN2uSESargfl+qrwMVQs8wQEB4wu/Sjpr Ky0qnszVHHk7WQ7ZGz7BqFicf4VS3hSCgm7s7YVPX3abWZx1I9uwkBy8LoRTUwiOytN3L3 IVJcXPUvrdmPFbewpeEGag8dtrfddxWToCfz31NyHF5FJTTWSqca4cCc4DLNyGe9NVh5rE MDLePgdICsD+wTBV6KwyX+qos7LmVkBbxRUoLoRSDOfE5BjqJUoe/qTx4oZ6dg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1696866529; 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=X+oVfTqC76j1KleFzCRJpniXRpnWmOtaWGkOw3CLm40=; b=hy+xM6zhPbLTGo3aOxhEEYGNSFGnFR3S2eZS930IepxoEgSOhnUx00fK3w7RP2QYBu2XVd UO2bL9+lFiRLXQAQ== 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 , 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: <169686652860.3135.1102963688830441762.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 fry.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 (fry.vger.email [0.0.0.0]); Mon, 09 Oct 2023 08:49:20 -0700 (PDT) X-Spam-Level: ** The following commit has been merged into the x86/percpu branch of tip: Commit-ID: a3c7a64f9b764e200338130253dfe4488db03f4f Gitweb: https://git.kernel.org/tip/a3c7a64f9b764e200338130253dfe4488db03f4f Author: Uros Bizjak AuthorDate: Mon, 09 Oct 2023 17:13:48 +02:00 Committer: Ingo Molnar CommitterDate: Mon, 09 Oct 2023 17:45:05 +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 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)