Commit 096c6add authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds

[PATCH] parisc: Initialise restart_block

Calling sys_restart_syscall without having taking a signal
across a syscall leaves the restart_block uninitialized,
allowing malicious user code to crash the kernel.

FIX:

Define INIT_THREAD_INFO such that restart_block.fn is set to
the default do_not_restart_syscall.
Committed-by: default avatarCarlos O'Donell <carlos@parisc-linux.org>
parent b531330c
...@@ -18,12 +18,15 @@ struct thread_info { ...@@ -18,12 +18,15 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk) \ #define INIT_THREAD_INFO(tsk) \
{ \ { \
task: &tsk, \ .task = &tsk, \
exec_domain: &default_exec_domain, \ .exec_domain = &default_exec_domain, \
flags: 0, \ .flags = 0, \
cpu: 0, \ .cpu = 0, \
addr_limit: KERNEL_DS, \ .addr_limit = KERNEL_DS, \
preempt_count: 0, \ .preempt_count = 0, \
.restart_block = { \
.fn = do_no_restart_syscall \
} \
} }
#define init_thread_info (init_thread_union.thread_info) #define init_thread_info (init_thread_union.thread_info)
......
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