From patchwork Tue Jan 24 18:50:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 47828 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2319090wrn; Tue, 24 Jan 2023 10:54:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXtHCf07Md4yBAX8rT4z8ys8edGe18cOvEH0w/8Yz4ueu6RtWrQQvhFqJcLTiQvsHfv19Yt2 X-Received: by 2002:a05:6a00:1d11:b0:58e:2649:5bdb with SMTP id a17-20020a056a001d1100b0058e26495bdbmr11984985pfx.20.1674586439892; Tue, 24 Jan 2023 10:53:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674586439; cv=none; d=google.com; s=arc-20160816; b=NvIb2FRMVUuP4UW7khe68wc5mYnkWz/OrmwLBRYIF+ErwBUOxbmBXeF62ltZESug/B fv2p2uZhWJRxYIWJc3tzvxyiKc/dLV9xvK4R8EmElJqU08XpY5NpwwUMuQgVwzRNuQTg yxxFJX5xekwl7pwr2jNkLEFAMRp6tUk33nJd8G2buErJqpw34Ag2bGP+LqgvHrZzGFGU GuO2+VWx2HUsV62SCKobBSkKbLYS4HfxwqnMYRncvc6tmDxFF3EIQ+S6cX4srJTE/E/i qQ5G3wg8CVeUBIGjvyP99XYKlCyCm/iTBYRsZy0uq3SC/sjHpLlXyLkhAOkyro+ZSg4x o9zA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hLIvfi4r5u7OzosAZV+OYDBNGofasQ8/Lp1KvTu9jhA=; b=RyWup0RiI0qEo4J5mumeBoaL9rAFvagnLhmGe6z813taiXvSENvbMT1AldwDIbj/uA /C8f1qUIB3AKMalsuzB2dMkXYIl97y2tPxK4QBb4ip+Bl0lj7BY9g0fsFoFv5G4PUDpi QPeUOdbfI0ogKl+AaT7ttxA+zgLY+vIqQ1npTabPznKG0GiJOQMXYp85Atf0zhj+ROzb bcIkpUorCpE3oOcHWt9VR8l3tG6Hx8vtco49/tfD7yGviqTPmlUKk9hW1soacx5+XTPs 7/w25S9beGZwRQEkTRG8I2cbIsj+j7LtR2YRFKk+Lwiua6tpYBk+4O6Dp7Q96tgz0lmS OnAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hPRqhYfA; 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=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cg19-20020a056a00291300b00589170e18cesi3052625pfb.170.2023.01.24.10.53.47; Tue, 24 Jan 2023 10:53:59 -0800 (PST) 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 header.i=@kernel.org header.s=k20201202 header.b=hPRqhYfA; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234071AbjAXSwP (ORCPT + 99 others); Tue, 24 Jan 2023 13:52:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233944AbjAXSwF (ORCPT ); Tue, 24 Jan 2023 13:52:05 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 417202BF13; Tue, 24 Jan 2023 10:52:05 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D458D61330; Tue, 24 Jan 2023 18:52:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 291BBC4339B; Tue, 24 Jan 2023 18:52:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674586324; bh=FJr8BjrY0TIgcS5b++r8ZCSIVGNroe0iaKdta2nV8tU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hPRqhYfAAwS2D4UwqLKr7br8D3sFNtDuz1WqxABvTidT6NHiPbhd4DU3Vas76Bb2F JoSSlVn+wKXv3/d1K3a+ytz8zSk465FdOgwUzsLr23Fds2HlmnO/XpmNjwUQA6tQTZ Upg2rUoDo1hoRUxQdmPyCnjoqPxG9Qanncdf5eq56x2wQ+BJDRj1Ug0IqBz+eNkkSH qyLlzrqGVfDycGG4gnqgz2+cxim2YA6l1pmlEBmK/fwUMBgB2uyCohLiyr023D43AH 3jbZCumbSXOh+ztmEe8EDZlshcYrkHM5GrqrOgJoDQgB6YvY7jERq56tut5PEXrxQ1 Beu78xbyek35g== From: Eric Biggers To: stable@vger.kernel.org, Greg Kroah-Hartman Cc: Kees Cook , SeongJae Park , Seth Jenkins , Jann Horn , "Eric W . Biederman" , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, Andrey Ryabinin , Baoquan He , Jonathan Corbet , Xuefeng Li , Tiezhu Yang , Marco Elver , Andrew Morton , Linus Torvalds Subject: [PATCH 5.15 05/20] kasan: no need to unset panic_on_warn in end_report() Date: Tue, 24 Jan 2023 10:50:55 -0800 Message-Id: <20230124185110.143857-6-ebiggers@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230124185110.143857-1-ebiggers@kernel.org> References: <20230124185110.143857-1-ebiggers@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755931150659762892?= X-GMAIL-MSGID: =?utf-8?q?1755931150659762892?= From: Tiezhu Yang commit e7ce7500375a63348e1d3a703c8d5003cbe3fea6 upstream. panic_on_warn is unset inside panic(), so no need to unset it before calling panic() in end_report(). Link: https://lkml.kernel.org/r/1644324666-15947-6-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Tiezhu Yang Reviewed-by: Marco Elver Cc: Andrey Ryabinin Cc: Baoquan He Cc: Jonathan Corbet Cc: Xuefeng Li Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Eric Biggers --- mm/kasan/report.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/mm/kasan/report.c b/mm/kasan/report.c index 884a950c70265..bf17704b302fc 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -117,16 +117,8 @@ static void end_report(unsigned long *flags, unsigned long addr) pr_err("==================================================================\n"); add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE); spin_unlock_irqrestore(&report_lock, *flags); - if (panic_on_warn && !test_bit(KASAN_BIT_MULTI_SHOT, &kasan_flags)) { - /* - * This thread may hit another WARN() in the panic path. - * Resetting this prevents additional WARN() from panicking the - * system on this thread. Other threads are blocked by the - * panic_mutex in panic(). - */ - panic_on_warn = 0; + if (panic_on_warn && !test_bit(KASAN_BIT_MULTI_SHOT, &kasan_flags)) panic("panic_on_warn set ...\n"); - } if (kasan_arg_fault == KASAN_ARG_FAULT_PANIC) panic("kasan.fault=panic set ...\n"); kasan_enable_current();