Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1634095pxb; Wed, 9 Feb 2022 00:42:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxX1cuSGutKTuH1ppR0s2Qs0kWGTdj9LgRwmgzTOLTRpGxIEjLUebzA76NSqbZWA918sEFP X-Received: by 2002:a17:902:f60f:: with SMTP id n15mr1120562plg.34.1644396138555; Wed, 09 Feb 2022 00:42:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644396138; cv=none; d=google.com; s=arc-20160816; b=OYRaU9QH4VzGZq6fUODO0DYIQhaMMvTgQPzazmP87bWzIkYzYjw0ETHww2nY2KHmZu Fxp0gfypZXzse4EPgj4NhxdDoqRta+PIyL3zLMGkj5AYHrPOh3cata1uOwyk36BC9Sdf IKiapRFGnRYOWnhi1mu+tkQT0fsPwzoJlW8fIK7h5tpCHOmrFJVZHRSG0yU/7eHbowO3 /9KJyl5UhGKS3dSekWC9M4dczmafWQlua4stwExHXGH5WGzzGZowV277Izijhg1r3Drl df9e80msKvpkpaRk6VdJhQYDmiW+3NZT7x2grYYKKfNRmI9Jao6JhysW84a1mkMvbdIl wErA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=2Q8GGwxOP3YVve+830JMFK+d5ayFOGiGaSg5RbYCCpw=; b=F90vEAzpot6ifRHqVGWuXXSdsLtpHK8QvOWzM1O8Bd3I68Y3+GcVWNyu8WQAwsQGen ELSuaYidqPxugsrke6VIfrrEMFiWvscI41SpP/l6p0JwRdOIjmqyaRTcteuKUtNk0nX7 AB3OEETBuXIVGpXTbXcLx2A7WvyElLEuv7e6pfzBwpL1xRU3X4Mo5KxkN9Hnjbn03ddR rx3YHNqIZNMgRXHOZ3NJXuwUaD4Vae+IrL79GR161rAzkDjkOCvHbuMP7bOB3+PSaBmS ZezJP9CR0St53baZSF5oYrySxt8tRLBV1DgdMzWcaeC5wOVpjDEaoV+VuycJgTsgNAhS yJ8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id ik28si3972891plb.3.2022.02.09.00.42.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 00:42:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 77EF8C050CF8; Wed, 9 Feb 2022 00:40:10 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350204AbiBHNTk (ORCPT + 99 others); Tue, 8 Feb 2022 08:19:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376339AbiBHM5Z (ORCPT ); Tue, 8 Feb 2022 07:57:25 -0500 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9B1BCC03FED1; Tue, 8 Feb 2022 04:57:22 -0800 (PST) Received: from linux.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxL+M6ZwJik0oIAA--.26524S6; Tue, 08 Feb 2022 20:51:09 +0800 (CST) From: Tiezhu Yang To: Baoquan He , Jonathan Corbet , Andrew Morton , Marco Elver , Andrey Ryabinin Cc: Xuefeng Li , kexec@lists.infradead.org, linux-doc@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/5] ubsan: no need to unset panic_on_warn in ubsan_epilogue() Date: Tue, 8 Feb 2022 20:51:05 +0800 Message-Id: <1644324666-15947-5-git-send-email-yangtiezhu@loongson.cn> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1644324666-15947-1-git-send-email-yangtiezhu@loongson.cn> References: <1644324666-15947-1-git-send-email-yangtiezhu@loongson.cn> X-CM-TRANSID: AQAAf9DxL+M6ZwJik0oIAA--.26524S6 X-Coremail-Antispam: 1UD129KBjvdXoWrZF18uF1rKFWfAr48Zw47Jwb_yoWfJrX_CF yvgFs7KrWktr15uw4rKwsrZr9ru3429a109F4xWwsFk3y8ta40gF4kZr4kZFyYgw45AF9x Aws8XFySyr4rCjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbyAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUAVCq3wA2048vs2 IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28E F7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr 1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_GcCE3s1l e2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI 8IcVAFwI0_JrI_JrylYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwAC jcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lFIxGxcIEc7CjxVA2Y2ka0x kIwI1lc2xSY4AK67AK6ryUMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4U MI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67 AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0 cI8IcVCY1x0267AKxVWxJVW8Jr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4 A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU 0xZFpf9x0JUSjgxUUUUU= X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 panic_on_warn is unset inside panic(), so no need to unset it before calling panic() in ubsan_epilogue(). Signed-off-by: Tiezhu Yang --- lib/ubsan.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/ubsan.c b/lib/ubsan.c index bdc380f..36bd75e 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) -- 2.1.0