- 01 Sep, 2019 1 commit
-
-
Max Filippov authored
Provide a Kconfig choice to select whether only the default ABI, only call0 ABI or both are supported. The default for XEA2 is windowed, but it may change for XEA3. Call0 only runs userspace with PS.WOE disabled. Supporting both windowed and call0 ABIs is tricky, as there's no indication in the ELF binaries which ABI they use. So it is done by probing: each process is started with PS.WOE disabled, but the handler of an illegal instruction exception taken with PS.WOE retries faulting instruction after enabling PS.WOE. It must happen before any signal is delivered to the process, otherwise it may be delivered incorrectly. Signed-off-by:
Max Filippov <jcmvbkbc@gmail.com>
-
- 27 May, 2019 1 commit
-
-
Eric W. Biederman authored
All of the remaining callers pass current into force_sig so remove the task parameter to make this obvious and to make misuse more difficult in the future. This also makes it clear force_sig passes current into force_sig_info. Signed-off-by:
"Eric W. Biederman" <ebiederm@xmission.com>
-
- 04 Jan, 2019 1 commit
-
-
Linus Torvalds authored
Nobody has actually used the type (VERIFY_READ vs VERIFY_WRITE) argument of the user address range verification function since we got rid of the old racy i386-only code to walk page tables by hand. It existed because the original 80386 would not honor the write protect bit when in kernel mode, so you had to do COW by hand before doing any user access. But we haven't supported that in a long time, and these days the 'type' argument is a purely historical artifact. A discussion about extending 'user_access_begin()' to do the range checking resulted this patch, because there is no way we're going to move the old VERIFY_xyz interface to that model. And it's best done at the end of the merge window when I've done most of my merges, so let's just get this done once and for all. This patch was mostly done with a sed-script, with manual fix-ups for the cases that weren't of the trivial 'access_ok(VERIFY_xyz' form. There were a couple of notable cases: - csk...
-
- 17 Dec, 2018 1 commit
-
-
Max Filippov authored
For the sake of clarity define macro NO_SYSCALL and use it for setting/checking struct pt_regs::syscall field. Signed-off-by:
Max Filippov <jcmvbkbc@gmail.com>
-
- 17 Dec, 2017 1 commit
-
-
Max Filippov authored
Replace #ifdef'fed/commented out debug printk statements with pr_debug. Replace printk statements with pr_* equivalents. Signed-off-by:
Max Filippov <jcmvbkbc@gmail.com>
-
- 01 May, 2017 1 commit
-
-
Max Filippov authored
Define macros SPILL_SLOT* that return a reference to the stack location of the spill slot for specific register and use them instead of opencoded address calculations. Signed-off-by:
Max Filippov <jcmvbkbc@gmail.com>
-
- 02 Mar, 2017 1 commit
-
-
Ingo Molnar authored
We are going to split <linux/sched/task_stack.h> out of <linux/sched.h>, which will have to be picked up from other headers and a couple of .c files. Create a trivial placeholder <linux/sched/task_stack.h> file that just maps to <linux/sched.h> to make this patch obviously correct and bisectable. Include the new header in the files that are going to need it. Acked-by:
Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by:
Ingo Molnar <mingo@kernel.org>
-
- 24 Dec, 2016 1 commit
-
-
Linus Torvalds authored
This was entirely automated, using the script by Al: PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*<asm/uaccess.h>' sed -i -e "s!$PATT!#include <linux/uaccess.h>!" \ $(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h) to do the replacement at the end of the merge window. Requested-by:
Al Viro <viro@zeniv.linux.org.uk> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- 12 Apr, 2015 2 commits
-
-
Richard Weinberger authored
As execution domain support is gone we can remove signal translation from the signal code and remove exec_domain from thread_info. Signed-off-by:
Richard Weinberger <richard@nod.at>
-
Al Viro authored
Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- 13 Feb, 2015 1 commit
-
-
Andy Lutomirski authored
If an attacker can cause a controlled kernel stack overflow, overwriting the restart block is a very juicy exploit target. This is because the restart_block is held in the same memory allocation as the kernel stack. Moving the restart block to struct task_struct prevents this exploit by making the restart_block harder to locate. Note that there are other fields in thread_info that are also easy targets, at least on some architectures. It's also a decent simplification, since the restart code is more or less identical on all architectures. [james.hogan@imgtec.com: metag: align thread_info::supervisor_stack] Signed-off-by:
Andy Lutomirski <luto@amacapital.net> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Kees Cook <keescook@chromium.org> Cc: David Miller <davem@davemloft.net> Acked-by:
Richard Weinberger <richard@nod.at> Cc: Richard H...
-
- 06 Aug, 2014 1 commit
-
-
Richard Weinberger authored
Use the more generic functions get_signal() signal_setup_done() for signal delivery. Signed-off-by:
Richard Weinberger <richard@nod.at>
-
- 15 Oct, 2013 1 commit
-
-
Baruch Siach authored
According to create_thread(3): "The new thread does not inherit the creating thread's alternate signal stack". Since commit f9a3879a (Fix sigaltstack corruption among cloned threads), current->sas_ss_size is set to 0 for cloned processes sharing VM with their parent. Don't use the (nonexistent) alternate signal stack in this case. This has been broken since commit 29c4dfd9 ([XTENSA] Remove non-rt signal handling). Fixes the SA_ONSTACK part of the nptl/tst-cancel20 test from uClibc. Cc: <stable@vger.kernel.org> Signed-off-by:
Baruch Siach <baruch@tkos.co.il> Signed-off-by:
Max Filippov <jcmvbkbc@gmail.com> Signed-off-by:
Chris Zankel <chris@zankel.net>
-
- 24 Feb, 2013 1 commit
-
-
Chris Zankel authored
The Xtensa architecture provides a global register called THREADPTR for the purpose of Thread Local Storage (TLS) support. This allows us to use a fairly simple implementation, keeping the thread pointer in the regset and simply saving and restoring it upon entering/exiting the from user space. Signed-off-by:
Chris Zankel <chris@zankel.net>
-
- 03 Feb, 2013 1 commit
-
-
Al Viro authored
Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- 19 Dec, 2012 1 commit
-
-
Chris Zankel authored
Remove heading and trailing spaces, trim trailing lines, and wrap lines that are longer than 80 characters. Signed-off-by:
Chris Zankel <chris@zankel.net>
-
- 01 Oct, 2012 2 commits
-
-
Richard Weinberger authored
This include is no longer needed. (seems to be a leftover from try_to_freeze()) Signed-off-by:
Richard Weinberger <richard@nod.at> Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
Al Viro authored
asm glue checks that Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- 04 Jun, 2012 1 commit
-
-
Al Viro authored
Obvious brainos spotted by Geert. Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- 01 Jun, 2012 6 commits
-
-
Al Viro authored
Does block_sigmask() + tracehook_signal_handler(); called when sigframe has been successfully built. All architectures converted to it; block_sigmask() itself is gone now (merged into this one). I'm still not too happy with the signature, but that's a separate story (IMO we need a structure that would contain signal number + siginfo + k_sigaction, so that get_signal_to_deliver() would fill one, signal_delivered(), handle_signal() and probably setup...frame() - take one). Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
Al Viro authored
Only 3 out of 63 do not. Renamed the current variant to __set_current_blocked(), added set_current_blocked() that will exclude unblockable signals, switched open-coded instances to it. Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
Al Viro authored
get_signal_to_deliver() will handle it itself Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
Al Viro authored
Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
Al Viro authored
replace boilerplate "should we use ->saved_sigmask or ->blocked?" with calls of obvious inlined helper... Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
Al Viro authored
first fruits of ..._restore_sigmask() helpers: now we can take boilerplate "signal didn't have a handler, clear RESTORE_SIGMASK and restore the blocked mask from ->saved_mask" into a common helper. Open-coded instances switched... Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- 24 May, 2012 1 commit
-
-
Al Viro authored
Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- 22 May, 2012 3 commits
-
-
Al Viro authored
Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
Al Viro authored
Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
Al Viro authored
Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
-
- 23 Apr, 2012 1 commit
-
-
Paul Gortmaker authored
Caused by commit 3785006a "xtensa: don't mask signals if we fail to setup signal stack" It assigns a return value to "ret", but there is no such variable anywhere in scope. Create one. Cc: Oleg Nesterov <oleg@redhat.com> Cc: Chris Zankel <chris@zankel.net> Acked-by:
Matt Fleming <matt.fleming@intel.com> Signed-off-by:
Paul Gortmaker <paul.gortmaker@windriver.com>
-
- 22 Mar, 2012 4 commits
-
-
Matt Fleming authored
As described in commit e6fa16ab ("signal: sigprocmask() should do retarget_shared_pending()") the modification of current->blocked is incorrect as we need to check whether the signal we're about to block is pending in the shared queue. Also, use the new helper function introduced in commit 5e6292c0 ("signal: add block_sigmask() for adding sigmask to current->blocked") which centralises the code for updating current->blocked after successfully delivering a signal and reduces the amount of duplicate code across architectures. In the past some architectures got this code wrong, so using this helper function should stop that from happening again. Acked-by:
Oleg Nesterov <oleg@redhat.com> Cc: Chris Zankel <chris@zankel.net> Signed-off-by:
Matt Fleming <matt.fleming@intel.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
Matt Fleming authored
setup_frame() needs to return an indication of whether it succeeded or failed in setting up the signal stack frame. If setup_frame() fails then we must not modify current->blocked. Acked-by:
Oleg Nesterov <oleg@redhat.com> Cc: Chris Zankel <chris@zankel.net> Signed-off-by:
Matt Fleming <matt.fleming@intel.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
Matt Fleming authored
get_signal_to_deliver() already resets the signal handler if SA_ONESHOT is set in ka->sa.sa_flags, there's no need to do it again in handle_signal(). Furthermore, because we were modifying ka->sa.sa_handler (which is a copy of sighand->action[]) instead of sighand->action[] the original code actually had no effect on signal delivery. Acked-by:
Oleg Nesterov <oleg@redhat.com> Cc: Chris Zankel <chris@zankel.net> Signed-off-by:
Matt Fleming <matt.fleming@intel.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
Matt Fleming authored
Instead of open coding the sequence from force_sigsegv() just call it. This also fixes a bug because we were modifying ka->sa.sa_handler (which is a copy of sighand->action[]), whereas the intention of the code was to modify sighand->action[] directly. As the original code was working with a copy it had no effect on signal delivery. Acked-by:
Oleg Nesterov <oleg@redhat.com> Cc: Chris Zankel <chris@zankel.net> Signed-off-by:
Matt Fleming <matt.fleming@intel.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- 14 Feb, 2008 3 commits
-
-
Chris Zankel authored
Supporting the sa_restorer function allows for better security since the sigreturn system call doesn't need to be placed on the stack, so the stack doesn't need to be executable. This requires support from the c-library as it has to provide the restorer function. Signed-off-by:
Chris Zankel <chris@zankel.net>
-
Chris Zankel authored
The Xtensa architecture allows to define custom instructions and registers. Registers that are bound to a coprocessor are only accessible if the corresponding enable bit is set, which allows to implement a 'lazy' context switch mechanism. Other registers needs to be saved and restore at the time of the context switch or during interrupt handling. This patch adds support for these additional states: - save and restore registers that are used by the compiler upon interrupt entry and exit. - context switch additional registers unbound to any coprocessor - 'lazy' context switch of registers bound to a coprocessor - ptrace interface to provide access to additional registers - update configuration files in include/asm-xtensa/variant-fsf Signed-off-by:
Chris Zankel <chris@zankel.net>
-
Chris Zankel authored
Remove oldmask from the sigcontext structure. Also update wmask and windowstart when we flush the AR registers to stack. Signed-off-by:
Chris Zankel <chris@zankel.net>
-
- 01 Jun, 2007 1 commit
-
-
Chris Zankel authored
The non-rt signal handling was never really used, so we don't break anything. This patch also cleans up the signal stack-frame to make it independent from the processor configuration. It also improves the method used for controlling single-stepping. We now save and restore the 'icountlevel' register that controls single stepping and set or clear the saved state to enable or disable it. Signed-off-by:
Chris Zankel <chris@zankel.net>
-
- 08 May, 2007 1 commit
-
-
Randy Dunlap authored
Remove includes of <linux/smp_lock.h> where it is not used/needed. Suggested by Al Viro. Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc, sparc64, and arm (all 59 defconfigs). Signed-off-by:
Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
- 10 Dec, 2006 1 commit
-
-
Chris Zankel authored
This is a long outstanding patch to finally fix the syscall interface. The constants used for the system calls are those we have provided in our libc patches. This patch also fixes the shmbuf and stat structure, and fcntl definitions. Signed-off-by:
Chris Zankel <chris@zankel.net> Signed-off-by:
Andrew Morton <akpm@osdl.org> Signed-off-by:
Linus Torvalds <torvalds@osdl.org>
-