Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3528912pxf; Mon, 15 Mar 2021 11:34:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0ENKDqld/zAg9ZmIFsZXzAf+FtihqGCHq3/V7tBU5a2mHkgGmxoQj3qOYeTS8ZLgrHice X-Received: by 2002:a17:907:1693:: with SMTP id hc19mr24848076ejc.28.1615833284657; Mon, 15 Mar 2021 11:34:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833284; cv=none; d=google.com; s=arc-20160816; b=vQeZo6CmV/6zPx4VvucyLMdrRrbITMS4YeCz54lgyeoJ/kOb1Z/Eivc6PvLYTL6izQ g5/PpNhxqSOu1tzZe8peoIH4NS1h77obWemh4pxN91N28MDx9+Ilons1CwG0IJHR/9Jm xVMF9zVvlNXAlSczUxQ+XpIOMY59nvHH3YdE6iGTK58SMBRRXrkCaaOCkpcN7JscsvjM Icm532brBPk5Vy1F80qEGYzCKJCTMxru4JSSCozBjEAyIq3YWfY2OhwnoExY3A8Q/e3z 3Kbusjn/GgdZMhRfCHTo9J1di9xKR5oVvD5TeKJBKTUK77XgTeSJi829SgC0cTwD1uSK HJfQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=c1KM3gefbO6k6wmdHYWR0MBRPwtxUtBif6dqq1ztCus=; b=nc03BeBoy6lk3FX1JvQygXfMcTM5XNOr5+Tu5FOTZBH1tj+XEdhigCpK2g9z0Y+rnj z22XJ7SIGv3nK+F+mw47JFhI1TNAtaxa3aA523v57PMS9F8YdbvGto4vM8vI9+qp0BT8 tHbstJIoRiwgKNPprd2NTZHSw3m0CUZAJXE8c1LkdAL/Xao+NpnY0XHAQl8NyWqK9tuD TpRCR5Z3DYp4a/YWoPrHDPkSLeUibSvAB6UFuHHZCMJlP10B0atjr1GB1p432e+QPSQY bV0I/k7h5vSyIaje8aK6HlyQq6sftBFSpHeeqypWklgcDHYdRi3+glv9/GFypm+CfjDu o3vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jrOTBncn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b65si12606967edf.391.2021.03.15.11.34.22; Mon, 15 Mar 2021 11:34:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jrOTBncn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239281AbhCOOqZ (ORCPT + 99 others); Mon, 15 Mar 2021 10:46:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:52484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234622AbhCOOEb (ORCPT ); Mon, 15 Mar 2021 10:04:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 445A864E83; Mon, 15 Mar 2021 14:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615817071; bh=aD9FFcm63Hj9Nhu8p+dI7qWaGC5qGSu94P5UNIjpjdg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jrOTBncntcbe9KS6IgcgH9gu7o1K6opLAn6h1KKV2q/RY12mo90Zx/UeOORvhBhaC jh4u04x1lFVc+XHwpOSOylou5h2T8xShZc7q3VtHrwelR7++niylwPOZPXx3qZR3qQ Ov3yZaKuKmr32gR4cPsihV1jiqbEnqG559+zdzms= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrey Konovalov , Catalin Marinas , Will Deacon , Vincenzo Frascino , Dmitry Vyukov , Andrey Ryabinin , Alexander Potapenko , Marco Elver , Peter Collingbourne , Evgenii Stepanov , Branislav Rankov , Kevin Brodsky , Andrew Morton , Linus Torvalds Subject: [PATCH 5.11 285/306] kasan: fix KASAN_STACK dependency for HW_TAGS Date: Mon, 15 Mar 2021 14:55:48 +0100 Message-Id: <20210315135517.316445703@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Andrey Konovalov commit d9b571c885a8974fbb7d4ee639dbc643fd000f9e upstream. There's a runtime failure when running HW_TAGS-enabled kernel built with GCC on hardware that doesn't support MTE. GCC-built kernels always have CONFIG_KASAN_STACK enabled, even though stack instrumentation isn't supported by HW_TAGS. Having that config enabled causes KASAN to issue MTE-only instructions to unpoison kernel stacks, which causes the failure. Fix the issue by disallowing CONFIG_KASAN_STACK when HW_TAGS is used. (The commit that introduced CONFIG_KASAN_HW_TAGS specified proper dependency for CONFIG_KASAN_STACK_ENABLE but not for CONFIG_KASAN_STACK.) Link: https://lkml.kernel.org/r/59e75426241dbb5611277758c8d4d6f5f9298dac.1615215441.git.andreyknvl@google.com Fixes: 6a63a63ff1ac ("kasan: introduce CONFIG_KASAN_HW_TAGS") Signed-off-by: Andrey Konovalov Reported-by: Catalin Marinas Cc: Cc: Will Deacon Cc: Vincenzo Frascino Cc: Dmitry Vyukov Cc: Andrey Ryabinin Cc: Alexander Potapenko Cc: Marco Elver Cc: Peter Collingbourne Cc: Evgenii Stepanov Cc: Branislav Rankov Cc: Kevin Brodsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- lib/Kconfig.kasan | 1 + 1 file changed, 1 insertion(+) --- a/lib/Kconfig.kasan +++ b/lib/Kconfig.kasan @@ -156,6 +156,7 @@ config KASAN_STACK_ENABLE config KASAN_STACK int + depends on KASAN_GENERIC || KASAN_SW_TAGS default 1 if KASAN_STACK_ENABLE || CC_IS_GCC default 0