Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1711479 > unrolled thread

[PATCH v3 4/4] arm64/syscalls: Move address limit check in loop

Started byThomas Garnier <thgarnie@google.com>
First post2017-08-14 23:40 +0200
Last post2017-08-14 23:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v3 4/4] arm64/syscalls: Move address limit check in loop Thomas Garnier <thgarnie@google.com> - 2017-08-14 23:40 +0200

#1711479 — [PATCH v3 4/4] arm64/syscalls: Move address limit check in loop

FromThomas Garnier <thgarnie@google.com>
Date2017-08-14 23:40 +0200
Subject[PATCH v3 4/4] arm64/syscalls: Move address limit check in loop
Message-ID<uevfz-Ui-5@gated-at.bofh.it>
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: cf7de27ab351 ("arm64/syscalls: Check address limit on user-mode return")
Reported-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Thomas Garnier <thgarnie@google.com>
---
 arch/arm64/kernel/signal.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/kernel/signal.c b/arch/arm64/kernel/signal.c
index c45214f8fb54..0bdc96c61bc0 100644
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -751,10 +751,10 @@ asmlinkage void do_notify_resume(struct pt_regs *regs,
 	 */
 	trace_hardirqs_off();
 
-	/* Check valid user FS if needed */
-	addr_limit_user_check();
-
 	do {
+		/* Check valid user FS if needed */
+		addr_limit_user_check();
+
 		if (thread_flags & _TIF_NEED_RESCHED) {
 			schedule();
 		} else {
-- 
2.14.1.480.gb18f417b89-goog

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web