linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] arm/syscalls: Move address limit check in loop
@ 2017-07-19 17:58 Thomas Garnier
  2017-07-19 17:58 ` [PATCH 2/3] arm/syscalls: Optimize work flags assembly check Thomas Garnier
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Thomas Garnier @ 2017-07-19 17:58 UTC (permalink / raw)
  To: linux-arm-kernel

The work pending loop can call set_fs after addr_limit_user_check
removed the _TIF_FSCHECK flag. To prevent the infinite loop, move
the addr_limit_user_check call at the beginning of the loop.

Fixes: 73ac5d6a2b6a ("arm/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/arm/kernel/signal.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 3a48b54c6405..f4574287d14b 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -573,10 +573,10 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)
 	 */
 	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 (likely(thread_flags & _TIF_NEED_RESCHED)) {
 			schedule();
 		} else {
-- 
2.14.0.rc0.284.gd933b75aa4-goog

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-07-26 18:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-19 17:58 [PATCH 1/3] arm/syscalls: Move address limit check in loop Thomas Garnier
2017-07-19 17:58 ` [PATCH 2/3] arm/syscalls: Optimize work flags assembly check Thomas Garnier
2017-07-19 17:59 ` [PATCH 3/3] arm64/syscalls: Move address limit check in loop Thomas Garnier
2017-07-24 17:07 ` [PATCH 1/3] arm/syscalls: " Thomas Garnier
2017-07-25 10:28   ` Leonard Crestez
2017-07-25 10:38     ` Russell King - ARM Linux
2017-07-25 20:01       ` Thomas Garnier
2017-07-26 12:02         ` Will Deacon
2017-07-26 14:20           ` Thomas Garnier
2017-07-26 18:25             ` Russell King - ARM Linux
2017-07-26 18:29               ` Thomas Garnier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).