From patchwork Tue Jan 24 18:50:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 47816 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2318717wrn; Tue, 24 Jan 2023 10:53:07 -0800 (PST) X-Google-Smtp-Source: AMrXdXseGfnY8UOScn6HaLdWtWYe8ekXeWI3p8PLe21jV2VG/JFAp8rZ+jrzCTKnAUHgB+g76R82 X-Received: by 2002:a17:90b:902:b0:226:164d:a19a with SMTP id bo2-20020a17090b090200b00226164da19amr52933243pjb.49.1674586386923; Tue, 24 Jan 2023 10:53:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674586386; cv=none; d=google.com; s=arc-20160816; b=WaMj2KY+jCrbroWlfNLkflnP995Afc/nYH1XRDLyakRUNkumegg7iV/hiMHntdQ1Ha sV8jBgInmBSxKMqxtzSmtcBKBufeZJcxnLnb3bfWTtXRtuPa9KL4YoCLQM+Xi6VpTCTZ r70PLwF0HbfEGS5Jlml2l4ojIalHTGZo3LWMRdUrrwGO/g4vxIL1/phvQ3V3wwvrJ3cU PAV/ssf4SX6xxX7ZjnRfzboGGpKN7IF+ELr7f5OBrSFe4ONFmh5gdfrLl8Lh+nyoy1co KNEkT2xIWaj96ZXNyDbD4m0AGo54aGDPKMYTXs/ULK5ZV5K3GQ9crrEM8oqscrDa+Dn2 Zp+A== 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=qJq5bZ8moayhp2wrMNhSV8PMfa0d6Ag/xLxZN4HHdic=; b=f+i2f5F7DNCzUmpChH3/SVLH/nBueVxyHoSwW9dqVpMqHlEMnk1Ti8h54p/p1hpJ3F Z7gz6Pn0g/d0DbZ3DTwvNT8iv3OYxeTcpSJqTffJy0cYSHe30IB7XP/Heb56AhBm/shm 8zJN+RWRpHSpTKqzVfk9Q54IX80IXdZGEYdTxYH3UESIBcXSMrLLFmqO6LdVySamRuqG QI0MoVv5v5acIYMsn069pg0BTHBroLxMztyiJp64gRJG2MrOPsU1lpvtBUtfPOglD11p zzeaK/7yQAPNw1eA+21uSboNA5fiwumvu8xKQqbdmrHtO6w46prJzpRKk9+Tm6I+9mC1 rEQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Vjt1XUXW; 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 b12-20020a63340c000000b004991efb7281si3032869pga.423.2023.01.24.10.52.52; Tue, 24 Jan 2023 10:53:06 -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=Vjt1XUXW; 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 S233737AbjAXSwN (ORCPT + 99 others); Tue, 24 Jan 2023 13:52:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233815AbjAXSwF (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 F1B6742DFD; Tue, 24 Jan 2023 10:52:04 -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 8FE5861333; Tue, 24 Jan 2023 18:52:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79868C433A1; Tue, 24 Jan 2023 18:52:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674586324; bh=yaiQwBn2rTDrZhwgXDYQi0ScGBCi5abPA1RpzOQ4srI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vjt1XUXWDXluHlh8RrTj9/dFkQbxY9dm0cIDoLMWmF7SENFQrleiigF2tOKM09Jw/ VZEeFsculLU9id7WocJkcfOuljqO7AsgHEYzm+GZFVsiTMplsKetB4g7pZrALuCG+P /SW6+QFS7vYl5gkb6bHUhVaMAzKaOKn/VnRZ7+IMYarn7xzAAnkohUlYXr/m5pu82a RcsTb53KAFetr51txcHdD+Zpvw9tAafssN3OiAmOShqZwQaIMPTGFjQfiIItGnec3F d2XMovkFJdqvIO0qUGV1C+LYCTIshLpy/X66caLpB1YoYi7GcWgitFsaoptL4bQHeE /2HhArVFOOEOw== 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 04/20] ubsan: no need to unset panic_on_warn in ubsan_epilogue() Date: Tue, 24 Jan 2023 10:50:54 -0800 Message-Id: <20230124185110.143857-5-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?1755931094831874791?= X-GMAIL-MSGID: =?utf-8?q?1755931094831874791?= From: Tiezhu Yang commit d83ce027a54068fabb70d2c252e1ce2da86784a4 upstream. panic_on_warn is unset inside panic(), so no need to unset it before calling panic() in ubsan_epilogue(). Link: https://lkml.kernel.org/r/1644324666-15947-5-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 --- lib/ubsan.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/ubsan.c b/lib/ubsan.c index bdc380ff5d5c7..36bd75e334263 100644 --- a/lib/ubsan.c +++ b/lib/ubsan.c @@ -154,16 +154,8 @@ static void ubsan_epilogue(void) current->in_ubsan--; - if (panic_on_warn) { - /* - * 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) panic("panic_on_warn set ...\n"); - } } void __ubsan_handle_divrem_overflow(void *_data, void *lhs, void *rhs)