Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5525979rwb; Wed, 7 Sep 2022 04:22:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR7Zu9LXr9QOkvm16s7huwjZ3ay6Elugh4mI7TzyrC3+1k0ZmQJobVL0iTyW0NCj5DnACdQ0 X-Received: by 2002:a17:90b:4c88:b0:1fe:1fde:97bb with SMTP id my8-20020a17090b4c8800b001fe1fde97bbmr29331091pjb.64.1662549775645; Wed, 07 Sep 2022 04:22:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662549775; cv=none; d=google.com; s=arc-20160816; b=aeNaqTTWGsIgr4KmIqByjHr9YMbpLiVpjqJMLYTWE8t0ZbFsqvuRNXM3vUzfMO9uUw cilDihrgSyHVtfm8khzjyq0g8nuSKONyYEtupuMFX+pQTaHI13FAipzzRCiHmB3Zk8Ki wfCQXz7QFVhyu98k9RqYS+pXQdcxtSCtLWPQ0NalCuOXu5yhSxxDz210eXyZGf+3fFny Lk1pFPvAXagJdOSbRMKAVAJfJQ7MYupKr52tKdT7PneIrqIoMKugowDyOHQvq9rnY1je OIanaVFoyzBQgqLRuqPL/OOOZ7LWlhajEsd86KHasev156fM2hlDFkVQxyDCzQtpPzb0 mgxw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=oNTEly+VN1w0GXZfx3c8iIp7/UMbftmaEYgIr51BAs0=; b=WQ8sP7CxEGpt+dsAV+KTcd1DC5v/xKRyy4ROYeSgIS4tL5EguxuiYyxZr/vmEJNSG4 Q7vg0kBBG4whh/fLMdbf0+LVw+PV9SU8DobBsFO1Z6j/DDPwEqGSm89PyLbMwprvJ9mh sbzKjJ6LtOnDqoWeVbSbxD7fP1rR1eP24IcErevvg3x0n4jql1ZFuoi83Lul64WVBDce wPDed/R/N+0yW2A7cgc1VstrXydtpdyDaCMvEV8m+yj8d1tJwKl2bNX4dFUGcw1r9tZw xOtTDOZzayOFebMCsK3Go62Czb050VpRI7riTVHHJxuje2M163RPWgU1MPPNpjQ3ZyaE XygA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=HKPmsEYC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h6-20020a170902680600b00176d3d9500asi4042176plk.305.2022.09.07.04.22.41; Wed, 07 Sep 2022 04:22:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=HKPmsEYC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229510AbiIGKGN (ORCPT + 99 others); Wed, 7 Sep 2022 06:06:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbiIGKFy (ORCPT ); Wed, 7 Sep 2022 06:05:54 -0400 Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C21337B7B5 for ; Wed, 7 Sep 2022 03:05:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1662545148; x=1694081148; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=oNTEly+VN1w0GXZfx3c8iIp7/UMbftmaEYgIr51BAs0=; b=HKPmsEYCpaUn9oI2GMpJqyrPIu0LtaTR1VDRnKRxSmBtm65V9H+XXfce T11BI5TrGd4m4TVZ/cXxNlTETWQomJFt81lkSmTVMvZPGQOvGWa1jfFBN 7sfe7KZ4ozOwApJx12gX+35Ll4qF5Da+JmsU294KrmyAsh4UA/uakOnlC cx2+30AlurjXjohjgoQruYkDP0ICRLFpbIRyGmaWR0o+xNf2vmwKlCVS9 MlifoTHDqIzHiUMkF7GhB0E/AYnxddy25WMg8RyAOoq2lS/xjn3q/7Z4q eTtBIao2OSXQvIpGPOQsqxxvvIRhX36LGRZa58FayKBAwl+Uio6TnqXBb g==; From: Vincent Whitchurch To: Richard Weinberger , Anton Ivanov , Johannes Berg CC: , Vincent Whitchurch , Patricia Alfonso , Dmitry Vyukov , Andrey Konovalov , , Subject: [PATCH] um: Prevent KASAN splats in dump_stack() Date: Wed, 7 Sep 2022 12:05:33 +0200 Message-ID: <20220907100533.1719128-1-vincent.whitchurch@axis.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use READ_ONCE_NOCHECK() when reading the stack to prevent KASAN splats when dump_stack() is used. Fixes: 5b301409e8bc5d7fad ("UML: add support for KASAN under x86_64") Signed-off-by: Vincent Whitchurch --- arch/um/kernel/sysrq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c index 7452f70d50d0..746715379f12 100644 --- a/arch/um/kernel/sysrq.c +++ b/arch/um/kernel/sysrq.c @@ -48,7 +48,8 @@ void show_stack(struct task_struct *task, unsigned long *stack, break; if (i && ((i % STACKSLOTS_PER_LINE) == 0)) pr_cont("\n"); - pr_cont(" %08lx", *stack++); + pr_cont(" %08lx", READ_ONCE_NOCHECK(*stack)); + stack++; } printk("%sCall Trace:\n", loglvl); -- 2.34.1