History log of /linux-master/arch/um/kernel/signal.c
Revision Date Author Comments
# a5571984 09-Nov-2023 Benjamin Berg <benjamin@sipsolutions.net>

um: Drop support for hosts without SYSEMU_SINGLESTEP support

These features have existed since Linux 2.6.14 and can be considered
widely available at this point. Also drop the backward compatibility
code for PTRACE_SETOPTIONS.

Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>

----

v2:
* Continue to define PTRACE_SYSEMU_SINGLESTEP as glibc only added it in
version 2.27.
Signed-off-by: Richard Weinberger <richard@nod.at>


# c200e4bb 26-Apr-2022 Eric W. Biederman <ebiederm@xmission.com>

ptrace/um: Replace PT_DTRACE with TIF_SINGLESTEP

User mode linux is the last user of the PT_DTRACE flag. Using the flag to indicate
single stepping is a little confusing and worse changing tsk->ptrace without locking
could potentionally cause problems.

So use a thread info flag with a better name instead of flag in tsk->ptrace.

Remove the definition PT_DTRACE as uml is the last user.

Cc: stable@vger.kernel.org
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Tested-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Link: https://lkml.kernel.org/r/20220505182645.497868-3-ebiederm@xmission.com
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>


# df561f66 23-Aug-2020 Gustavo A. R. Silva <gustavoars@kernel.org>

treewide: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>


# 0d1fb0a4 25-Aug-2019 Alex Dewar <alex.dewar@gmx.co.uk>

um: Add SPDX headers to files in arch/um/kernel/

Convert files to use SPDX header. All files are licensed under the
GPLv2.

Signed-off-by: Alex Dewar <alex.dewar@gmx.co.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>


# 0dafcbe1 23-Aug-2019 Johannes Berg <johannes.berg@intel.com>

um: Implement TRACE_IRQFLAGS_SUPPORT

UML enables TRACE_IRQFLAGS_SUPPORT but doesn't actually implement
it. It seems to have been added for lockdep support, but that can't
actually really work well without IRQ flags tracing, as is also
very noisily reported when enabling CONFIG_DEBUG_LOCKDEP.

Implement it now.

Fixes: 711553efa5b8 ("[PATCH] uml: declare in Kconfig our partial LOCKDEP support")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>


# 322740ef 25-Jan-2016 Richard Weinberger <richard@nod.at>

Revert "um: Fix get_signal() usage"

Commit db2f24dc240856fb1d78005307f1523b7b3c121b
was plain wrong. I did not realize the we are
allowed to loop here.
In fact we have to loop and must not return to userspace
before all SIGSEGVs have been delivered.
Other archs do this directly in their entry code, UML
does it here.

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>


# db2f24dc 18-Nov-2015 Richard Weinberger <richard@nod.at>

um: Fix get_signal() usage

If get_signal() returns us a signal to post
we must not call it again, otherwise the already
posted signal will be overridden.
Before commit a610d6e672d this was the case as we stopped
the while after a successful handle_signal().

Cc: <stable@vger.kernel.org> # 3.10-
Fixes: a610d6e672d ("pull clearing RESTORE_SIGMASK into block_sigmask()")
Signed-off-by: Richard Weinberger <richard@nod.at>


# ccaee5f8 03-Jul-2015 Ingo Molnar <mingo@kernel.org>

um: Fix do_signal() prototype

Once x86 exports its do_signal(), the prototypes will clash.

Fix the clash and also improve the code a bit: remove the
unnecessary kern_do_signal() indirection. This allows
interrupt_end() to share the 'regs' parameter calculation.

Also remove the unused return code to match x86.

Minimally build and boot tested.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Richard Weinberger <richard.weinberger@gmail.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: paulmck@linux.vnet.ibm.com
Link: http://lkml.kernel.org/r/67c57eac09a589bac3c6c5ff22f9623ec55a184a.1435952415.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>


# 307627ee 06-Oct-2013 Richard Weinberger <richard@nod.at>

um: Use get_signal() signal_setup_done()

Use the more generic functions get_signal() signal_setup_done()
for signal delivery.

Signed-off-by: Richard Weinberger <richard@nod.at>


# 9a8c1359 19-Jul-2013 Richard Weinberger <richard@nod.at>

um: siginfo cleanup

Currently we use both struct siginfo and siginfo_t.
Let's use struct siginfo internally to avoid ongoing
compiler warning. We are allowed to do so because
struct siginfo and siginfo_t are equivalent.

Signed-off-by: Richard Weinberger <richard@nod.at>


# 15ce1f71 25-Dec-2012 Al Viro <viro@zeniv.linux.org.uk>

x86,um: switch to generic old sigsuspend()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>


# 6bf9adfc 14-Dec-2012 Al Viro <viro@zeniv.linux.org.uk>

introduce generic sys_sigaltstack(), switch x86 and um to it

Conditional on CONFIG_GENERIC_SIGALTSTACK; architectures that do not
select it are completely unaffected

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>


# 37185b33 07-Oct-2012 Al Viro <viro@ZenIV.linux.org.uk>

um: get rid of pointless include "..." where include <...> will do

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>


# f9a38eac 06-Sep-2012 Al Viro <viro@zeniv.linux.org.uk>

um: let signal_delivered() do SIGTRAP on singlestepping into handler

... rather than duplicating that in sigframe setup code (and doing that
inconsistently, at that)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>


# 8e2c85aa 06-Sep-2012 Al Viro <viro@zeniv.linux.org.uk>

um: let signal_delivered() do SIGTRAP on singlestepping into handler

... rather than duplicating that in sigframe setup code (and doing that
inconsistently, at that)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>


# efee984c 28-Apr-2012 Al Viro <viro@zeniv.linux.org.uk>

new helper: signal_delivered()

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>


# 77097ae5 27-Apr-2012 Al Viro <viro@zeniv.linux.org.uk>

most of set_current_blocked() callers want SIGKILL/SIGSTOP removed from set

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>


# a610d6e6 21-May-2012 Al Viro <viro@zeniv.linux.org.uk>

pull clearing RESTORE_SIGMASK into block_sigmask()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>


# b7f9a11a 02-May-2012 Al Viro <viro@zeniv.linux.org.uk>

new helper: sigmask_to_save()

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>


# 51a7b448 21-May-2012 Al Viro <viro@zeniv.linux.org.uk>

new helper: restore_saved_sigmask()

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>


# 68f3f16d 21-May-2012 Al Viro <viro@zeniv.linux.org.uk>

new helper: sigsuspend()

guts of saved_sigmask-based sigsuspend/rt_sigsuspend. Takes
kernel sigset_t *.

Open-coded instances replaced with calling it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>


# 5a30a798 26-Apr-2012 Al Viro <viro@zeniv.linux.org.uk>

um: wrong sigmask saved in case of multiple sigframes

we can't just find oldmask once; if there are multiple signals
and we loop building sigframes for those, ->saved_mask will be
definitely wrong for all but the first one.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>


# 3b7d15bd 22-Apr-2012 Al Viro <viro@zeniv.linux.org.uk>

um: ->restart_block.fn needs to be reset on sigreturn

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>


# d982d595 23-Mar-2012 Matt Fleming <matt.fleming@intel.com>

um: use set_current_blocked() and block_sigmask()

As described in commit e6fa16ab9c1e ("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 5e6292c0f28f
("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: Richard Weinberger <richard@nod.at>
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>


# f6adb9a6 23-Mar-2012 Matt Fleming <matt.fleming@intel.com>

um: don't restore current->blocked on error

If we fail to setup the signal stack frame then we don't need to restore
current->blocked because it is not modified by setup_signal_stack_*.

Acked-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Richard Weinberger <richard@nod.at>
Tested-by: Richard Weinberger <richard@nod.at>
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>


# adcfb985 18-Aug-2011 Al Viro <viro@ftp.linux.org.uk>

um: kill includes of sysdep/sigcontext.h from stuff built with kernel headers

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Richard Weinberger <richard@nod.at>


# 3be311e3 17-Aug-2008 Al Viro <viro@zeniv.linux.org.uk>

x86, um: sanitize uml sigcontext.h uses

a) the only difference between sigcontext and sysdep/sigcontext
is that the former contains externs for two long-dead functions.
Removed, switched the only user to sysdep/sigcontext

b) asm/sigcontext.h is removable - that of underlying architecture
would get used.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>


# c5d4bb17 04-Feb-2008 Jeff Dike <jdike@addtoit.com>

uml: style fixes in arch/um/kernel

Joe Perches noticed some printks in smp.c that needed fixing.

While I was in there, I did the usual tidying in arch/um/kernel, which
should be fairly style-clean at this point:
copyright updates
emacs formatting comments removal
include tidying
style fixes

Cc: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# ba180fd4 16-Oct-2007 Jeff Dike <jdike@addtoit.com>

uml: style fixes pass 3

Formatting changes in the files which have been changed in the course
of folding foo_skas functions into their callers. These include:
copyright updates
header file trimming
style fixes
adding severity to printks

These changes should be entirely non-functional.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 77bf4400 16-Oct-2007 Jeff Dike <jdike@addtoit.com>

uml: remove code made redundant by CHOOSE_MODE removal

This patch makes a number of simplifications enabled by the removal of
CHOOSE_MODE. There were lots of functions that looked like

int foo(args){
foo_skas(args);
}

The bodies of foo_skas are now folded into foo, and their declarations (and
sometimes entire header files) are deleted.

In addition, the union uml_pt_regs, which was a union between the tt and skas
register formats, is now a struct, with the tt-mode arm of the union being
removed.

It turns out that usr2_handler was unused, so it is gone.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 9218b171 06-May-2007 Jeff Dike <jdike@addtoit.com>

uml: remove user_util.h

user_util.h isn't needed any more, so delete it and remove all includes of it.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 7c7a8949 06-Mar-2007 Jeff Dike <jdike@addtoit.com>

[PATCH] uml: fix formatting violations in signal delivery code

Fix a few formatting bugs in the signal code.

Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 038b0a6d 04-Oct-2006 Dave Jones <davej@redhat.com>

Remove all inclusions of <linux/config.h>
kbuild explicitly includes this at build time.

Signed-off-by: Dave Jones <davej@redhat.com>


# 1d3468a6 10-Jul-2006 Jeff Dike <jdike@addtoit.com>

[PATCH] uml: move _kern.c files

Move most *_kern.c files in arch/um/kernel to *.c. This makes UML somewhat
more closely resemble the other arches.

[akpm@osdl.org: use the new INTF_* flags]
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>