x86/entry: A couple of small fixes
Subsystems (2)
cover x86/entry: A couple of small fixes
- Syzbot reported a missing local_irq_disable() in exc_alignment_check()
- A missing noinstr annotation
- Make a function static which is not longer used from ASM code
Thanks,
tglx
PATCH 1/3 x86/traps: Disable interrupts in exc_aligment_check()
exc_alignment_check() fails to disable interrupts before returning to the entry code.
--- arch/x86/kernel/traps.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/kernel/traps.c +2 -0
@@ -303,6 +303,8 @@ DEFINE_IDTENTRY_ERRORCODE(exc_alignment_do_trap (X86_TRAP_AC ,SIGBUS ,"alignment check" , regs, error_code,BUS_ADRALN ,NULL ); + +local_irq_disable (); }#ifdef CONFIG_VMAP_STACK
[tip: x86/urgent] x86/traps: Disable interrupts in exc_aligment_check()
The following commit has been merged into the x86/urgent branch of tip:
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: bce9b042ec73e8662b8119d4ca47e7c78b20d0bf Gitweb: https://git.kernel.org/tip/bce9b042ec73e8662b8119d4ca47e7c78b20d0bf Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 08 Jul 2020 21:28:05 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Thu, 09 Jul 2020 11:18:29 +02:00
x86/traps: Disable interrupts in exc_aligment_check()
exc_alignment_check() fails to disable interrupts before returning to the entry code.
--- arch/x86/kernel/traps.c | 2 ++ 1 file changed, 2 insertions(+)
arch/x86/kernel/traps.c +2 -0
@@ -299,6 +299,8 @@ DEFINE_IDTENTRY_ERRORCODE(exc_alignment_check)do_trap (X86_TRAP_AC ,SIGBUS ,"alignment check" , regs, error_code,BUS_ADRALN ,NULL ); + +local_irq_disable (); }#ifdef CONFIG_VMAP_STACK
PATCH 2/3 x86/entry: Mark check_user_regs() noinstr
In reply to Thomas GleixnerIt's called from the non-instrumentable section.
--- arch/x86/entry/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/entry/common.c +1 -1
@@ -46,7 +46,7 @@#include <trace/events/syscalls.h> /* Check that the stack and regs on entry from user mode are sane. */ -static void check_user_regs (struct pt_regs *regs) +static noinstr void check_user_regs(struct pt_regs *regs) {if (IS_ENABLED (CONFIG_DEBUG_ENTRY )) {/*
[tip: x86/urgent] x86/entry: Mark check_user_regs() noinstr
The following commit has been merged into the x86/urgent branch of tip:
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: 006e1ced516d2bfd9db63a32b5dba3c2abf43b04 Gitweb: https://git.kernel.org/tip/006e1ced516d2bfd9db63a32b5dba3c2abf43b04 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 08 Jul 2020 21:28:06 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Thu, 09 Jul 2020 11:18:29 +02:00
x86/entry: Mark check_user_regs() noinstr
It's called from the non-instrumentable section.
--- arch/x86/entry/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/entry/common.c +1 -1
@@ -46,7 +46,7 @@#include <trace/events/syscalls.h> /* Check that the stack and regs on entry from user mode are sane. */ -static void check_user_regs (struct pt_regs *regs) +static noinstr void check_user_regs(struct pt_regs *regs) {if (IS_ENABLED (CONFIG_DEBUG_ENTRY )) {/*
PATCH 3/3 x86/entry/common: Make prepare_exit_to_usermode() static
In reply to Thomas GleixnerNo users outside this file anymore.
--- arch/x86/entry/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/entry/common.c +1 -1
@@ -294,7 +294,7 @@ static void __prepare_exit_to_usermode(s#endif } -__visible noinstr void prepare_exit_to_usermode(struct pt_regs *regs) +static noinstr void prepare_exit_to_usermode(struct pt_regs *regs) {instrumentation_begin ();__prepare_exit_to_usermode (regs);
[tip: x86/urgent] x86/entry/common: Make prepare_exit_to_usermode() static
The following commit has been merged into the x86/urgent branch of tip:
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: bd87e6f6610aa96fde01ee6653e162213f7ec836 Gitweb: https://git.kernel.org/tip/bd87e6f6610aa96fde01ee6653e162213f7ec836 Author: Thomas Gleixner <[email protected]> AuthorDate: Wed, 08 Jul 2020 21:28:07 +02:00 Committer: Thomas Gleixner <[email protected]> CommitterDate: Thu, 09 Jul 2020 11:18:30 +02:00
x86/entry/common: Make prepare_exit_to_usermode() static
No users outside this file anymore.
--- arch/x86/entry/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/entry/common.c +1 -1
@@ -294,7 +294,7 @@ static void __prepare_exit_to_usermode(struct pt_regs *regs)#endif } -__visible noinstr void prepare_exit_to_usermode(struct pt_regs *regs) +static noinstr void prepare_exit_to_usermode(struct pt_regs *regs) {instrumentation_begin ();__prepare_exit_to_usermode (regs);
Quoted 5 lines · Thomas Gleixner
- Syzbot reported a missing
local_irq_disable()inexc_alignment_check()
- A missing noinstr annotation
- Make a function static which is not longer used from ASM code
All are:
-Andy
Quoted 4 lines
Thanks,
tglx
Signature · 2 lines
Andy Lutomirski AMA Capital Management, LLC
Quoted 3 lines · Thomas Gleixner
- Syzbot reported a missing
local_irq_disable()inexc_alignment_check()
- A missing noinstr annotation
- Make a function static which is not longer used from ASM code