From patchwork Mon Oct 9 15:48:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 150174 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1959393vqo; Mon, 9 Oct 2023 08:49:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWCIALpD+lJ/UR2AUC2RTisZrqgVCr1zza71L4jJgvD5OVnDb1SrP8ikXqlXY7jCGzd9ku X-Received: by 2002:a17:90b:1b4c:b0:274:9823:b481 with SMTP id nv12-20020a17090b1b4c00b002749823b481mr14569145pjb.9.1696866546464; Mon, 09 Oct 2023 08:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696866546; cv=none; d=google.com; s=arc-20160816; b=buHvFqkU4Y0uVOnha3F3u/kNt3XvGDLiBc/j8ohV06wzB0zrWxb0CSQqBOZAIglUM0 5rp0isnzYKp1tTaS3+j96d+MBnaye9H3Kbg9kAgyDyWPa9W8wKUQ09pNVOvqU9gZfslB F8GXQCQQVrhnvNOsYeCA9jgAg1Rwbj39LGJogZs5p7WZstmGbybQT8Y3yPZaVZqvMcwU oKLpJQF6CWpBbMin2Kvd4OcrgHIVkrfSvfDW++5sVP5M4INY1gH40uvTgXW1j0KeD9es idZdzczH2m30v8yf0XcxusJOLsFVuDh+2/Z0Pgs6uOgKLcf6Fq3KtspzSKVVSbITsHI9 rV5g== 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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id v4-20020a17090a898400b00263f3c1bb86si9797995pjn.158.2023.10.09.08.49.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 08:49:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; 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; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 544AB80A52B6; Mon, 9 Oct 2023 08:49:04 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377015AbjJIPs4 (ORCPT + 18 others); Mon, 9 Oct 2023 11:48:56 -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 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 morse.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 (morse.vger.email [0.0.0.0]); Mon, 09 Oct 2023 08:49:04 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779291440248777255 X-GMAIL-MSGID: 1779293535745867365 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)