Skip to content

Commit d683a85

Browse files
misalehMarc Zyngier
authored andcommitted
ubsan: Remove regs from report_ubsan_failure()
report_ubsan_failure() doesn't use argument regs, and soon it will be called from the hypervisor context were regs are not available. So, remove the unused argument. Signed-off-by: Mostafa Saleh <smostafa@google.com> Acked-by: Kees Cook <kees@kernel.org> Link: https://lore.kernel.org/r/20250430162713.1997569-3-smostafa@google.com Signed-off-by: Marc Zyngier <maz@kernel.org>
1 parent dc1fd37 commit d683a85

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

arch/arm64/kernel/traps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ static struct break_hook kasan_break_hook = {
11181118
#ifdef CONFIG_UBSAN_TRAP
11191119
static int ubsan_handler(struct pt_regs *regs, unsigned long esr)
11201120
{
1121-
die(report_ubsan_failure(regs, esr & UBSAN_BRK_MASK), regs, esr);
1121+
die(report_ubsan_failure(esr & UBSAN_BRK_MASK), regs, esr);
11221122
return DBG_HOOK_HANDLED;
11231123
}
11241124

arch/x86/kernel/traps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ static noinstr bool handle_bug(struct pt_regs *regs)
351351
case BUG_UD1_UBSAN:
352352
if (IS_ENABLED(CONFIG_UBSAN_TRAP)) {
353353
pr_crit("%s at %pS\n",
354-
report_ubsan_failure(regs, ud_imm),
354+
report_ubsan_failure(ud_imm),
355355
(void *)regs->ip);
356356
}
357357
break;

include/linux/ubsan.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#define _LINUX_UBSAN_H
44

55
#ifdef CONFIG_UBSAN_TRAP
6-
const char *report_ubsan_failure(struct pt_regs *regs, u32 check_type);
6+
const char *report_ubsan_failure(u32 check_type);
77
#else
8-
static inline const char *report_ubsan_failure(struct pt_regs *regs, u32 check_type)
8+
static inline const char *report_ubsan_failure(u32 check_type)
99
{
1010
return NULL;
1111
}

lib/ubsan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
* The mappings of struct SanitizerKind (the -fsanitize=xxx args) to
2626
* enum SanitizerHandler (the traps) in Clang is in clang/lib/CodeGen/.
2727
*/
28-
const char *report_ubsan_failure(struct pt_regs *regs, u32 check_type)
28+
const char *report_ubsan_failure(u32 check_type)
2929
{
3030
switch (check_type) {
3131
#ifdef CONFIG_UBSAN_BOUNDS

0 commit comments

Comments
 (0)