Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1608001
| From | Kees Cook <keescook@chromium.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH] lib/syscall: Clear return values when no stack |
| Date | 2017-03-23 23:50 +0100 |
| Message-ID | <tojIl-wf-7@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Commit aa1f1a639621 ("lib/syscall: Pin the task stack in collect_syscall()")
added logic to handle a process stack not existing, but left sp and pc
uninitialized, which can be later reported via /proc/$pid/syscall for zombie
processes, potentially exposing kernel memory to userspace.
Zombie /proc/$pid/syscall before:
-1 0xffffffff9a060100 0xffff92f42d6ad900
Zombie /proc/$pid/syscall after:
-1 0x0 0x0
Reported-by: Robert Święcki <robert@swiecki.net>
Fixes: aa1f1a639621 ("lib/syscall: Pin the task stack in collect_syscall()")
Cc: stable@vger.kernel.org # v4.9+
Signed-off-by: Kees Cook <keescook@chromium.org>
---
lib/syscall.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/syscall.c b/lib/syscall.c
index 17d5ff5fa6a3..2c6cd1b5c3ea 100644
--- a/lib/syscall.c
+++ b/lib/syscall.c
@@ -12,6 +12,7 @@ static int collect_syscall(struct task_struct *target, long *callno,
if (!try_get_task_stack(target)) {
/* Task has no stack, so the task isn't in a syscall. */
+ *sp = *pc = 0;
*callno = -1;
return 0;
}
--
2.7.4
--
Kees Cook
Pixel Security
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH] lib/syscall: Clear return values when no stack Kees Cook <keescook@chromium.org> - 2017-03-23 23:50 +0100 Re: [PATCH] lib/syscall: Clear return values when no stack Andy Lutomirski <luto@kernel.org> - 2017-03-24 00:10 +0100 [tip:core/urgent] lib/syscall: Clear return values when no stack tip-bot for Kees Cook <tipbot@zytor.com> - 2017-03-24 08:00 +0100
csiph-web