Commit 24da760a authored by Tiezhu Yang's avatar Tiezhu Yang Committed by sanglipeng
Browse files

ubsan: no need to unset panic_on_warn in ubsan_epilogue()

stable inclusion
from stable-v5.10.166
commit b857b42a8c0992256d3129bce141724e4eb2b438
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7TH9O

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b857b42a8c0992256d3129bce141724e4eb2b438

--------------------------------

commit d83ce027 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: default avatarTiezhu Yang <yangtiezhu@loongson.cn>
Reviewed-by: default avatarMarco Elver <elver@google.com>
Cc: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Xuefeng Li <lixuefeng@loongson.cn>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent f6c1d9ea
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -151,17 +151,9 @@ 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");
}
}

static void handle_overflow(struct overflow_data *data, void *lhs,
			void *rhs, char op)