Commit a2048e34 authored by Thomas Garnier's avatar Thomas Garnier Committed by Thomas Gleixner

arm64/syscalls: Move address limit check in loop

A bug was reported on ARM where set_fs might be called after it was
checked on the work pending function. ARM64 is not affected by this bug
but has a similar construct. In order to avoid any similar problems in
the future, the addr_limit_user_check function is moved at the beginning
of the loop.

Fixes: cf7de27a ("arm64/syscalls: Check address limit on user-mode return")
Reported-by: default avatarLeonard Crestez <>
Signed-off-by: default avatarThomas Garnier <>
Signed-off-by: default avatarKees Cook <>
Signed-off-by: default avatarThomas Gleixner <>
Cc: Pratyush Anand <>
Cc: Dave Martin <>
Cc: Will Drewry <>
Cc: Arnd Bergmann <>
Cc: Catalin Marinas <>
Cc: Will Deacon <>
Cc: Russell King <>
Cc: Andy Lutomirski <>
Cc: David Howells <>
Cc: Dave Hansen <>
Cc: Al Viro <>
Cc: Yonghong Song <>
parent e33f8d32
......@@ -751,10 +751,10 @@ asmlinkage void do_notify_resume(struct pt_regs *regs,
/* Check valid user FS if needed */
do {
/* Check valid user FS if needed */
if (thread_flags & _TIF_NEED_RESCHED) {
} else {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment