Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a610d6e6
Commit
a610d6e6
authored
May 21, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pull clearing RESTORE_SIGMASK into block_sigmask()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
5754f412
Changes
34
Show whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
130 additions
and
387 deletions
+130
-387
arch/alpha/kernel/signal.c
arch/alpha/kernel/signal.c
+0
-5
arch/arm/kernel/signal.c
arch/arm/kernel/signal.c
+3
-15
arch/avr32/kernel/signal.c
arch/avr32/kernel/signal.c
+4
-7
arch/blackfin/kernel/signal.c
arch/blackfin/kernel/signal.c
+7
-17
arch/c6x/kernel/signal.c
arch/c6x/kernel/signal.c
+6
-17
arch/cris/arch-v10/kernel/signal.c
arch/cris/arch-v10/kernel/signal.c
+2
-12
arch/cris/arch-v32/kernel/signal.c
arch/cris/arch-v32/kernel/signal.c
+2
-13
arch/frv/kernel/signal.c
arch/frv/kernel/signal.c
+7
-17
arch/h8300/kernel/signal.c
arch/h8300/kernel/signal.c
+1
-3
arch/hexagon/kernel/signal.c
arch/hexagon/kernel/signal.c
+6
-20
arch/ia64/kernel/signal.c
arch/ia64/kernel/signal.c
+1
-9
arch/m32r/kernel/signal.c
arch/m32r/kernel/signal.c
+3
-5
arch/m68k/kernel/signal.c
arch/m68k/kernel/signal.c
+0
-2
arch/microblaze/kernel/signal.c
arch/microblaze/kernel/signal.c
+3
-14
arch/mips/kernel/signal.c
arch/mips/kernel/signal.c
+3
-15
arch/mn10300/kernel/signal.c
arch/mn10300/kernel/signal.c
+5
-13
arch/openrisc/kernel/signal.c
arch/openrisc/kernel/signal.c
+0
-2
arch/parisc/kernel/signal.c
arch/parisc/kernel/signal.c
+4
-6
arch/powerpc/kernel/signal.c
arch/powerpc/kernel/signal.c
+0
-7
arch/s390/kernel/compat_signal.c
arch/s390/kernel/compat_signal.c
+7
-3
arch/s390/kernel/entry.h
arch/s390/kernel/entry.h
+1
-1
arch/s390/kernel/signal.c
arch/s390/kernel/signal.c
+11
-21
arch/score/kernel/signal.c
arch/score/kernel/signal.c
+5
-19
arch/sh/kernel/signal_32.c
arch/sh/kernel/signal_32.c
+7
-19
arch/sh/kernel/signal_64.c
arch/sh/kernel/signal_64.c
+8
-16
arch/sparc/kernel/signal32.c
arch/sparc/kernel/signal32.c
+3
-12
arch/sparc/kernel/signal_32.c
arch/sparc/kernel/signal_32.c
+3
-13
arch/sparc/kernel/signal_64.c
arch/sparc/kernel/signal_64.c
+3
-12
arch/tile/kernel/signal.c
arch/tile/kernel/signal.c
+5
-20
arch/um/kernel/signal.c
arch/um/kernel/signal.c
+2
-14
arch/unicore32/kernel/signal.c
arch/unicore32/kernel/signal.c
+3
-15
arch/x86/kernel/signal.c
arch/x86/kernel/signal.c
+9
-22
arch/xtensa/kernel/signal.c
arch/xtensa/kernel/signal.c
+0
-1
kernel/signal.c
kernel/signal.c
+6
-0
No files found.
arch/alpha/kernel/signal.c
View file @
a610d6e6
...
@@ -481,11 +481,6 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
...
@@ -481,11 +481,6 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
return
;
return
;
}
}
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
/* A signal was successfully delivered, and the
saved sigmask was stored on the signal frame,
and will be restored by sigreturn. So we can
simply clear the restore sigmask flag. */
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
}
}
static
inline
void
static
inline
void
...
...
arch/arm/kernel/signal.c
View file @
a610d6e6
...
@@ -528,7 +528,7 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
...
@@ -528,7 +528,7 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
/*
/*
* OK, we're invoking a handler
* OK, we're invoking a handler
*/
*/
static
int
static
void
handle_signal
(
unsigned
long
sig
,
struct
k_sigaction
*
ka
,
handle_signal
(
unsigned
long
sig
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
struct
pt_regs
*
regs
)
siginfo_t
*
info
,
struct
pt_regs
*
regs
)
{
{
...
@@ -559,17 +559,14 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
...
@@ -559,17 +559,14 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
if
(
ret
!=
0
)
{
if
(
ret
!=
0
)
{
force_sigsegv
(
sig
,
tsk
);
force_sigsegv
(
sig
,
tsk
);
return
ret
;
return
;
}
}
/*
/*
* Block the signal if we were successful.
* Block the signal if we were successful.
*/
*/
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
tracehook_signal_handler
(
sig
,
info
,
ka
,
regs
,
0
);
tracehook_signal_handler
(
sig
,
info
,
ka
,
regs
,
0
);
return
0
;
}
}
/*
/*
...
@@ -633,16 +630,7 @@ static void do_signal(struct pt_regs *regs, int syscall)
...
@@ -633,16 +630,7 @@ static void do_signal(struct pt_regs *regs, int syscall)
clear_thread_flag
(
TIF_SYSCALL_RESTARTSYS
);
clear_thread_flag
(
TIF_SYSCALL_RESTARTSYS
);
}
}
if
(
handle_signal
(
signr
,
&
ka
,
&
info
,
regs
)
==
0
)
{
handle_signal
(
signr
,
&
ka
,
&
info
,
regs
);
/*
* A signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TIF_RESTORE_SIGMASK flag.
*/
if
(
test_thread_flag
(
TIF_RESTORE_SIGMASK
))
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
}
return
;
return
;
}
}
...
...
arch/avr32/kernel/signal.c
View file @
a610d6e6
...
@@ -238,16 +238,13 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
...
@@ -238,16 +238,13 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
*/
*/
ret
|=
!
valid_user_regs
(
regs
);
ret
|=
!
valid_user_regs
(
regs
);
if
(
ret
!=
0
)
{
force_sigsegv
(
sig
,
current
);
return
;
}
/*
/*
* Block the signal if we were successful.
* Block the signal if we were successful.
*/
*/
if
(
ret
!=
0
)
force_sigsegv
(
sig
,
current
);
else
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
}
}
/*
/*
...
...
arch/blackfin/kernel/signal.c
View file @
a610d6e6
...
@@ -247,7 +247,7 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler)
...
@@ -247,7 +247,7 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler)
/*
/*
* OK, we're invoking a handler
* OK, we're invoking a handler
*/
*/
static
int
static
void
handle_signal
(
int
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
handle_signal
(
int
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
)
struct
pt_regs
*
regs
)
{
{
...
@@ -260,11 +260,12 @@ handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka,
...
@@ -260,11 +260,12 @@ handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka,
/* set up the stack frame */
/* set up the stack frame */
ret
=
setup_rt_frame
(
sig
,
ka
,
info
,
sigmask_to_save
(),
regs
);
ret
=
setup_rt_frame
(
sig
,
ka
,
info
,
sigmask_to_save
(),
regs
);
if
(
ret
)
return
;
if
(
ret
==
0
)
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
tracehook_signal_handler
(
sig
,
info
,
ka
,
regs
,
return
ret
;
test_thread_flag
(
TIF_SINGLESTEP
))
;
}
}
/*
/*
...
@@ -290,18 +291,7 @@ asmlinkage void do_signal(struct pt_regs *regs)
...
@@ -290,18 +291,7 @@ asmlinkage void do_signal(struct pt_regs *regs)
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
if
(
signr
>
0
)
{
if
(
signr
>
0
)
{
/* Whee! Actually deliver the signal. */
/* Whee! Actually deliver the signal. */
if
(
handle_signal
(
signr
,
&
info
,
&
ka
,
regs
)
==
0
)
{
handle_signal
(
signr
,
&
info
,
&
ka
,
regs
);
/* a signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TIF_RESTORE_SIGMASK flag */
if
(
test_thread_flag
(
TIF_RESTORE_SIGMASK
))
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
tracehook_signal_handler
(
signr
,
&
info
,
&
ka
,
regs
,
test_thread_flag
(
TIF_SINGLESTEP
));
}
return
;
return
;
}
}
...
...
arch/c6x/kernel/signal.c
View file @
a610d6e6
...
@@ -248,7 +248,7 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler)
...
@@ -248,7 +248,7 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler)
/*
/*
* handle the actual delivery of a signal to userspace
* handle the actual delivery of a signal to userspace
*/
*/
static
int
handle_signal
(
int
sig
,
static
void
handle_signal
(
int
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
,
int
syscall
)
struct
pt_regs
*
regs
,
int
syscall
)
{
{
...
@@ -277,11 +277,10 @@ static int handle_signal(int sig,
...
@@ -277,11 +277,10 @@ static int handle_signal(int sig,
}
}
/* Set up the stack frame */
/* Set up the stack frame */
ret
=
setup_rt_frame
(
sig
,
ka
,
info
,
sigmask_to_save
(),
regs
);
if
(
setup_rt_frame
(
sig
,
ka
,
info
,
sigmask_to_save
(),
regs
)
<
0
)
if
(
ret
==
0
)
return
;
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
tracehook_signal_handler
(
sig
,
info
,
ka
,
regs
,
0
);
return
ret
;
}
}
/*
/*
...
@@ -300,17 +299,7 @@ static void do_signal(struct pt_regs *regs, int syscall)
...
@@ -300,17 +299,7 @@ static void do_signal(struct pt_regs *regs, int syscall)
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
if
(
signr
>
0
)
{
if
(
signr
>
0
)
{
if
(
handle_signal
(
signr
,
&
info
,
&
ka
,
regs
,
syscall
)
==
0
)
{
handle_signal
(
signr
,
&
info
,
&
ka
,
regs
,
syscall
);
/* a signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TIF_RESTORE_SIGMASK flag */
if
(
test_thread_flag
(
TIF_RESTORE_SIGMASK
))
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
tracehook_signal_handler
(
signr
,
&
info
,
&
ka
,
regs
,
0
);
}
return
;
return
;
}
}
...
...
arch/cris/arch-v10/kernel/signal.c
View file @
a610d6e6
...
@@ -415,7 +415,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
...
@@ -415,7 +415,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
* OK, we're invoking a handler
* OK, we're invoking a handler
*/
*/
static
inline
int
handle_signal
(
int
canrestart
,
unsigned
long
sig
,
static
inline
void
handle_signal
(
int
canrestart
,
unsigned
long
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
)
struct
pt_regs
*
regs
)
{
{
...
@@ -458,8 +458,6 @@ static inline int handle_signal(int canrestart, unsigned long sig,
...
@@ -458,8 +458,6 @@ static inline int handle_signal(int canrestart, unsigned long sig,
if
(
ret
==
0
)
if
(
ret
==
0
)
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
return
ret
;
}
}
/*
/*
...
@@ -492,15 +490,7 @@ void do_signal(int canrestart, struct pt_regs *regs)
...
@@ -492,15 +490,7 @@ void do_signal(int canrestart, struct pt_regs *regs)
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
if
(
signr
>
0
)
{
if
(
signr
>
0
)
{
/* Whee! Actually deliver the signal. */
/* Whee! Actually deliver the signal. */
if
(
handle_signal
(
canrestart
,
signr
,
&
info
,
&
ka
,
handle_signal
(
canrestart
,
signr
,
&
info
,
&
ka
,
regs
);
regs
))
{
/* a signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TIF_RESTORE_SIGMASK flag */
if
(
test_thread_flag
(
TIF_RESTORE_SIGMASK
))
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
}
return
;
return
;
}
}
...
...
arch/cris/arch-v32/kernel/signal.c
View file @
a610d6e6
...
@@ -434,7 +434,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
...
@@ -434,7 +434,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
}
}
/* Invoke a signal handler to, well, handle the signal. */
/* Invoke a signal handler to, well, handle the signal. */
static
inline
int
static
inline
void
handle_signal
(
int
canrestart
,
unsigned
long
sig
,
handle_signal
(
int
canrestart
,
unsigned
long
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
)
struct
pt_regs
*
regs
)
...
@@ -491,8 +491,6 @@ handle_signal(int canrestart, unsigned long sig,
...
@@ -491,8 +491,6 @@ handle_signal(int canrestart, unsigned long sig,
if
(
ret
==
0
)
if
(
ret
==
0
)
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
return
ret
;
}
}
/*
/*
...
@@ -525,16 +523,7 @@ do_signal(int canrestart, struct pt_regs *regs)
...
@@ -525,16 +523,7 @@ do_signal(int canrestart, struct pt_regs *regs)
if
(
signr
>
0
)
{
if
(
signr
>
0
)
{
/* Whee! Actually deliver the signal. */
/* Whee! Actually deliver the signal. */
if
(
handle_signal
(
canrestart
,
signr
,
&
info
,
&
ka
,
handle_signal
(
canrestart
,
signr
,
&
info
,
&
ka
,
regs
);
regs
))
{
/* a signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TIF_RESTORE_SIGMASK flag */
if
(
test_thread_flag
(
TIF_RESTORE_SIGMASK
))
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
}
return
;
return
;
}
}
...
...
arch/frv/kernel/signal.c
View file @
a610d6e6
...
@@ -426,7 +426,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
...
@@ -426,7 +426,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
/*
/*
* OK, we're invoking a handler
* OK, we're invoking a handler
*/
*/
static
int
handle_signal
(
unsigned
long
sig
,
siginfo_t
*
info
,
static
void
handle_signal
(
unsigned
long
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
)
struct
k_sigaction
*
ka
)
{
{
sigset_t
*
oldset
=
sigmask_to_save
();
sigset_t
*
oldset
=
sigmask_to_save
();
...
@@ -461,11 +461,12 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
...
@@ -461,11 +461,12 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
else
else
ret
=
setup_frame
(
sig
,
ka
,
oldset
);
ret
=
setup_frame
(
sig
,
ka
,
oldset
);
if
(
ret
==
0
)
if
(
ret
)
block_sigmask
(
ka
,
sig
);
return
;
return
ret
;
block_sigmask
(
ka
,
sig
);
tracehook_signal_handler
(
sig
,
info
,
ka
,
__frame
,
test_thread_flag
(
TIF_SINGLESTEP
));
}
/* end handle_signal() */
}
/* end handle_signal() */
/*****************************************************************************/
/*****************************************************************************/
...
@@ -495,18 +496,7 @@ static void do_signal(void)
...
@@ -495,18 +496,7 @@ static void do_signal(void)
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
__frame
,
NULL
);
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
__frame
,
NULL
);
if
(
signr
>
0
)
{
if
(
signr
>
0
)
{
if
(
handle_signal
(
signr
,
&
info
,
&
ka
)
==
0
)
{
handle_signal
(
signr
,
&
info
,
&
ka
);
/* a signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TIF_RESTORE_SIGMASK flag */
if
(
test_thread_flag
(
TIF_RESTORE_SIGMASK
))
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
tracehook_signal_handler
(
signr
,
&
info
,
&
ka
,
__frame
,
test_thread_flag
(
TIF_SINGLESTEP
));
}
return
;
return
;
}
}
...
...
arch/h8300/kernel/signal.c
View file @
a610d6e6
...
@@ -442,10 +442,8 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
...
@@ -442,10 +442,8 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
else
else
ret
=
setup_frame
(
sig
,
ka
,
oldset
,
regs
);
ret
=
setup_frame
(
sig
,
ka
,
oldset
,
regs
);
if
(
!
ret
)
{
if
(
!
ret
)
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
}
}
}
/*
/*
...
...
arch/hexagon/kernel/signal.c
View file @
a610d6e6
...
@@ -149,11 +149,9 @@ static int setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info,
...
@@ -149,11 +149,9 @@ static int setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info,
/*
/*
* Setup invocation of signal handler
* Setup invocation of signal handler
*/
*/
static
int
handle_signal
(
int
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
static
void
handle_signal
(
int
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
)
struct
pt_regs
*
regs
)
{
{
int
rc
;
/*
/*
* If we're handling a signal that aborted a system call,
* If we're handling a signal that aborted a system call,
* set up the error return value before adding the signal
* set up the error return value before adding the signal
...
@@ -186,15 +184,13 @@ static int handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka,
...
@@ -186,15 +184,13 @@ static int handle_signal(int sig, siginfo_t *info, struct k_sigaction *ka,
* Set up the stack frame; not doing the SA_SIGINFO thing. We
* Set up the stack frame; not doing the SA_SIGINFO thing. We
* only set up the rt_frame flavor.
* only set up the rt_frame flavor.
*/
*/
rc
=
setup_rt_frame
(
sig
,
ka
,
info
,
sigmask_to_save
(),
regs
);
/* If there was an error on setup, no signal was delivered. */
/* If there was an error on setup, no signal was delivered. */
if
(
rc
)
if
(
setup_rt_frame
(
sig
,
ka
,
info
,
sigmask_to_save
(),
regs
)
<
0
)
return
rc
;
return
;
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
tracehook_signal_handler
(
sig
,
info
,
ka
,
regs
,
return
0
;
test_thread_flag
(
TIF_SINGLESTEP
))
;
}
}
/*
/*
...
@@ -215,17 +211,7 @@ static void do_signal(struct pt_regs *regs)
...
@@ -215,17 +211,7 @@ static void do_signal(struct pt_regs *regs)
signo
=
get_signal_to_deliver
(
&
info
,
&
sigact
,
regs
,
NULL
);
signo
=
get_signal_to_deliver
(
&
info
,
&
sigact
,
regs
,
NULL
);
if
(
signo
>
0
)
{
if
(
signo
>
0
)
{
if
(
handle_signal
(
signo
,
&
info
,
&
sigact
,
regs
)
==
0
)
{
handle_signal
(
signo
,
&
info
,
&
sigact
,
regs
);
/*
* Successful delivery case. The saved sigmask is
* stored in the signal frame, and will be restored
* by sigreturn. We can clear the TIF flag.
*/
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
tracehook_signal_handler
(
signo
,
&
info
,
&
sigact
,
regs
,
test_thread_flag
(
TIF_SINGLESTEP
));
}
return
;
return
;
}
}
...
...
arch/ia64/kernel/signal.c
View file @
a610d6e6
...
@@ -501,17 +501,9 @@ ia64_do_signal (struct sigscratch *scr, long in_syscall)
...
@@ -501,17 +501,9 @@ ia64_do_signal (struct sigscratch *scr, long in_syscall)
* Whee! Actually deliver the signal. If the delivery failed, we need to
* Whee! Actually deliver the signal. If the delivery failed, we need to
* continue to iterate in this loop so we can deliver the SIGSEGV...
* continue to iterate in this loop so we can deliver the SIGSEGV...
*/
*/
if
(
handle_signal
(
signr
,
&
ka
,
&
info
,
scr
))
{
if
(
handle_signal
(
signr
,
&
ka
,
&
info
,
scr
))
/*
* A signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TS_RESTORE_SIGMASK flag.
*/
current_thread_info
()
->
status
&=
~
TS_RESTORE_SIGMASK
;
return
;
return
;
}
}
}
/* Did we come from a system call? */
/* Did we come from a system call? */
if
(
restart
)
{
if
(
restart
)
{
...
...
arch/m32r/kernel/signal.c
View file @
a610d6e6
...
@@ -267,7 +267,7 @@ static int prev_insn(struct pt_regs *regs)
...
@@ -267,7 +267,7 @@ static int prev_insn(struct pt_regs *regs)
* OK, we're invoking a handler
* OK, we're invoking a handler
*/
*/
static
int
static
void
handle_signal
(
unsigned
long
sig
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
handle_signal
(
unsigned
long
sig
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
struct
pt_regs
*
regs
)
struct
pt_regs
*
regs
)
{
{
...
@@ -295,10 +295,9 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
...
@@ -295,10 +295,9 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
/* Set up the stack frame */
/* Set up the stack frame */
if
(
setup_rt_frame
(
sig
,
ka
,
info
,
sigmask_to_save
(),
regs
))
if
(
setup_rt_frame
(
sig
,
ka
,
info
,
sigmask_to_save
(),
regs
))
return
-
EFAULT
;
return
;
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
return
0
;
}
}
/*
/*
...
@@ -333,8 +332,7 @@ static void do_signal(struct pt_regs *regs)
...
@@ -333,8 +332,7 @@ static void do_signal(struct pt_regs *regs)
*/
*/
/* Whee! Actually deliver the signal. */
/* Whee! Actually deliver the signal. */
if
(
handle_signal
(
signr
,
&
ka
,
&
info
,
regs
)
==
0
)
handle_signal
(
signr
,
&
ka
,
&
info
,
regs
);
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
return
;
return
;
}
}
...
...
arch/m68k/kernel/signal.c
View file @
a610d6e6
...
@@ -1147,8 +1147,6 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
...
@@ -1147,8 +1147,6 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info,
regs
->
sr
&=
~
0x8000
;
regs
->
sr
&=
~
0x8000
;
send_sig
(
SIGTRAP
,
current
,
1
);
send_sig
(
SIGTRAP
,
current
,
1
);
}
}
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
}
}
/*
/*
...
...
arch/microblaze/kernel/signal.c
View file @
a610d6e6
...
@@ -310,7 +310,7 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler)
...
@@ -310,7 +310,7 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler)
* OK, we're invoking a handler
* OK, we're invoking a handler
*/
*/
static
int
static
void
handle_signal
(
unsigned
long
sig
,
struct
k_sigaction
*
ka
,
handle_signal
(
unsigned
long
sig
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
struct
pt_regs
*
regs
)
siginfo_t
*
info
,
struct
pt_regs
*
regs
)
{
{
...
@@ -324,11 +324,9 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
...
@@ -324,11 +324,9 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
ret
=
setup_rt_frame
(
sig
,
ka
,
NULL
,
oldset
,
regs
);
ret
=
setup_rt_frame
(
sig
,
ka
,
NULL
,
oldset
,
regs
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
;
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
return
0
;
}
}
/*
/*
...
@@ -356,16 +354,7 @@ static void do_signal(struct pt_regs *regs, int in_syscall)
...
@@ -356,16 +354,7 @@ static void do_signal(struct pt_regs *regs, int in_syscall)
/* Whee! Actually deliver the signal. */
/* Whee! Actually deliver the signal. */
if
(
in_syscall
)
if
(
in_syscall
)
handle_restart
(
regs
,
&
ka
,
1
);
handle_restart
(
regs
,
&
ka
,
1
);
if
(
!
handle_signal
(
signr
,
&
ka
,
&
info
,
oldset
,
regs
))
{
handle_signal
(
signr
,
&
ka
,
&
info
,
regs
);
/*
* A signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TS_RESTORE_SIGMASK flag.
*/
current_thread_info
()
->
status
&=
~
TS_RESTORE_SIGMASK
;
}
return
;
return
;
}
}
...
...
arch/mips/kernel/signal.c
View file @
a610d6e6
...
@@ -514,7 +514,7 @@ struct mips_abi mips_abi = {
...
@@ -514,7 +514,7 @@ struct mips_abi mips_abi = {
.
restart
=
__NR_restart_syscall
.
restart
=
__NR_restart_syscall
};
};
static
int
handle_signal
(
unsigned
long
sig
,
siginfo_t
*
info
,
static
void
handle_signal
(
unsigned
long
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
)
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
)
{
{
sigset_t
*
oldset
=
sigmask_to_save
();
sigset_t
*
oldset
=
sigmask_to_save
();
...
@@ -551,11 +551,9 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
...
@@ -551,11 +551,9 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
ka
,
regs
,
sig
,
oldset
);
ka
,
regs
,
sig
,
oldset
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
;
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
return
ret
;
}
}
static
void
do_signal
(
struct
pt_regs
*
regs
)
static
void
do_signal
(
struct
pt_regs
*
regs
)
...
@@ -575,17 +573,7 @@ static void do_signal(struct pt_regs *regs)
...
@@ -575,17 +573,7 @@ static void do_signal(struct pt_regs *regs)
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
if
(
signr
>
0
)
{
if
(
signr
>
0
)
{
/* Whee! Actually deliver the signal. */
/* Whee! Actually deliver the signal. */
if
(
handle_signal
(
signr
,
&
info
,
&
ka
,
regs
)
==
0
)
{
handle_signal
(
signr
,
&
info
,
&
ka
,
regs
);
/*
* A signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TIF_RESTORE_SIGMASK flag.
*/
if
(
test_thread_flag
(
TIF_RESTORE_SIGMASK
))
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
}
return
;
return
;
}
}
...
...
arch/mn10300/kernel/signal.c
View file @
a610d6e6
...
@@ -462,11 +462,12 @@ static int handle_signal(int sig,
...
@@ -462,11 +462,12 @@ static int handle_signal(int sig,
ret
=
setup_rt_frame
(
sig
,
ka
,
info
,
oldset
,
regs
);
ret
=
setup_rt_frame
(
sig
,
ka
,
info
,
oldset
,
regs
);
else
else
ret
=
setup_frame
(
sig
,
ka
,
oldset
,
regs
);
ret
=
setup_frame
(
sig
,
ka
,
oldset
,
regs
);
if
(
ret
)
return
;
if
(
ret
==
0
)
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
tracehook_signal_handler
(
sig
,
info
,
ka
,
regs
,
return
ret
;
test_thread_flag
(
TIF_SINGLESTEP
))
;
}
}
/*
/*
...
@@ -486,15 +487,6 @@ static void do_signal(struct pt_regs *regs)
...
@@ -486,15 +487,6 @@ static void do_signal(struct pt_regs *regs)
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
if
(
signr
>
0
)
{
if
(
signr
>
0
)
{
if
(
handle_signal
(
signr
,
&
info
,
&
ka
,
regs
)
==
0
)
{
if
(
handle_signal
(
signr
,
&
info
,
&
ka
,
regs
)
==
0
)
{
/* a signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TIF_RESTORE_SIGMASK flag */
if
(
test_thread_flag
(
TIF_RESTORE_SIGMASK
))
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
tracehook_signal_handler
(
signr
,
&
info
,
&
ka
,
regs
,
test_thread_flag
(
TIF_SINGLESTEP
));
}
}
return
;
return
;
...
...
arch/openrisc/kernel/signal.c
View file @
a610d6e6
...
@@ -263,8 +263,6 @@ handle_signal(unsigned long sig,
...
@@ -263,8 +263,6 @@ handle_signal(unsigned long sig,
return
;
return
;
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
tracehook_signal_handler
(
sig
,
info
,
ka
,
regs
,
tracehook_signal_handler
(
sig
,
info
,
ka
,
regs
,
test_thread_flag
(
TIF_SINGLESTEP
));
test_thread_flag
(
TIF_SINGLESTEP
));
}
}
...
...
arch/parisc/kernel/signal.c
View file @
a610d6e6
...
@@ -459,6 +459,9 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
...
@@ -459,6 +459,9 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
test_thread_flag
(
TIF_SINGLESTEP
)
||
test_thread_flag
(
TIF_SINGLESTEP
)
||
test_thread_flag
(
TIF_BLOCKSTEP
));
test_thread_flag
(
TIF_BLOCKSTEP
));
DBG
(
1
,
KERN_DEBUG
"do_signal: Exit (success), regs->gr[28] = %ld
\n
"
,
regs
->
gr
[
28
]);
return
1
;
return
1
;
}
}
...
@@ -593,14 +596,9 @@ do_signal(struct pt_regs *regs, long in_syscall)
...
@@ -593,14 +596,9 @@ do_signal(struct pt_regs *regs, long in_syscall)
/* Whee! Actually deliver the signal. If the
/* Whee! Actually deliver the signal. If the
delivery failed, we need to continue to iterate in
delivery failed, we need to continue to iterate in
this loop so we can deliver the SIGSEGV... */
this loop so we can deliver the SIGSEGV... */
if
(
handle_signal
(
signr
,
&
info
,
&
ka
,
regs
,
in_syscall
))
{
if
(
handle_signal
(
signr
,
&
info
,
&
ka
,
regs
,
in_syscall
))
DBG
(
1
,
KERN_DEBUG
"do_signal: Exit (success), regs->gr[28] = %ld
\n
"
,
regs
->
gr
[
28
]);
if
(
test_thread_flag
(
TIF_RESTORE_SIGMASK
))
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
return
;
return
;
}
}
}
/* end of while(1) looping forever if we can't force a signal */
/* end of while(1) looping forever if we can't force a signal */
/* Did we come from a system call? */
/* Did we come from a system call? */
...
...
arch/powerpc/kernel/signal.c
View file @
a610d6e6
...
@@ -159,13 +159,6 @@ static int do_signal(struct pt_regs *regs)
...
@@ -159,13 +159,6 @@ static int do_signal(struct pt_regs *regs)
regs
->
trap
=
0
;
regs
->
trap
=
0
;
if
(
ret
)
{
if
(
ret
)
{
block_sigmask
(
&
ka
,
signr
);
block_sigmask
(
&
ka
,
signr
);
/*
* A signal was successfully delivered; the saved sigmask is in
* its frame, and we can clear the TLF_RESTORE_SIGMASK flag.
*/
current_thread_info
()
->
local_flags
&=
~
_TLF_RESTORE_SIGMASK
;
/*
/*
* Let tracing know that we've done the handler setup.
* Let tracing know that we've done the handler setup.
*/
*/
...
...
arch/s390/kernel/compat_signal.c
View file @
a610d6e6
...
@@ -572,7 +572,7 @@ static int setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info,
...
@@ -572,7 +572,7 @@ static int setup_rt_frame32(int sig, struct k_sigaction *ka, siginfo_t *info,
* OK, we're invoking a handler
* OK, we're invoking a handler
*/
*/
int
handle_signal32
(
unsigned
long
sig
,
struct
k_sigaction
*
ka
,
void
handle_signal32
(
unsigned
long
sig
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
sigset_t
*
oldset
,
struct
pt_regs
*
regs
)
siginfo_t
*
info
,
sigset_t
*
oldset
,
struct
pt_regs
*
regs
)
{
{
int
ret
;
int
ret
;
...
@@ -583,8 +583,12 @@ int handle_signal32(unsigned long sig, struct k_sigaction *ka,
...
@@ -583,8 +583,12 @@ int handle_signal32(unsigned long sig, struct k_sigaction *ka,
else
else
ret
=
setup_frame32
(
sig
,
ka
,
oldset
,
regs
);
ret
=
setup_frame32
(
sig
,
ka
,
oldset
,
regs
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
;
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
return
0
;
/*
* Let tracing know that we've done the handler setup.
*/
tracehook_signal_handler
(
sig
,
info
,
ka
,
regs
,
test_thread_flag
(
TIF_SINGLE_STEP
));
}
}
arch/s390/kernel/entry.h
View file @
a610d6e6
...
@@ -31,7 +31,7 @@ void do_per_trap(struct pt_regs *regs);
...
@@ -31,7 +31,7 @@ void do_per_trap(struct pt_regs *regs);
void
syscall_trace
(
struct
pt_regs
*
regs
,
int
entryexit
);
void
syscall_trace
(
struct
pt_regs
*
regs
,
int
entryexit
);
void
kernel_stack_overflow
(
struct
pt_regs
*
regs
);
void
kernel_stack_overflow
(
struct
pt_regs
*
regs
);
void
do_signal
(
struct
pt_regs
*
regs
);
void
do_signal
(
struct
pt_regs
*
regs
);
int
handle_signal32
(
unsigned
long
sig
,
struct
k_sigaction
*
ka
,
void
handle_signal32
(
unsigned
long
sig
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
sigset_t
*
oldset
,
struct
pt_regs
*
regs
);
siginfo_t
*
info
,
sigset_t
*
oldset
,
struct
pt_regs
*
regs
);
void
do_notify_resume
(
struct
pt_regs
*
regs
);
void
do_notify_resume
(
struct
pt_regs
*
regs
);
...
...
arch/s390/kernel/signal.c
View file @
a610d6e6
...
@@ -367,7 +367,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
...
@@ -367,7 +367,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
return
-
EFAULT
;
return
-
EFAULT
;
}
}
static
int
handle_signal
(
unsigned
long
sig
,
struct
k_sigaction
*
ka
,
static
void
handle_signal
(
unsigned
long
sig
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
sigset_t
*
oldset
,
siginfo_t
*
info
,
sigset_t
*
oldset
,
struct
pt_regs
*
regs
)
struct
pt_regs
*
regs
)
{
{
...
@@ -379,9 +379,13 @@ static int handle_signal(unsigned long sig, struct k_sigaction *ka,
...
@@ -379,9 +379,13 @@ static int handle_signal(unsigned long sig, struct k_sigaction *ka,
else
else
ret
=
setup_frame
(
sig
,
ka
,
oldset
,
regs
);
ret
=
setup_frame
(
sig
,
ka
,
oldset
,
regs
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
;
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
return
0
;
/*
* Let tracing know that we've done the handler setup.
*/
tracehook_signal_handler
(
sig
,
info
,
ka
,
regs
,
test_thread_flag
(
TIF_SINGLE_STEP
));
}
}
/*
/*
...
@@ -436,24 +440,10 @@ void do_signal(struct pt_regs *regs)
...
@@ -436,24 +440,10 @@ void do_signal(struct pt_regs *regs)
/* No longer in a system call */
/* No longer in a system call */
clear_thread_flag
(
TIF_SYSCALL
);
clear_thread_flag
(
TIF_SYSCALL
);
if
((
is_compat_task
()
?
if
(
is_compat_task
())
handle_signal32
(
signr
,
&
ka
,
&
info
,
oldset
,
regs
)
:
handle_signal32
(
signr
,
&
ka
,
&
info
,
oldset
,
regs
);
handle_signal
(
signr
,
&
ka
,
&
info
,
oldset
,
regs
))
==
0
)
{
else
/*
handle_signal
(
signr
,
&
ka
,
&
info
,
oldset
,
regs
);
* A signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TIF_RESTORE_SIGMASK flag.
*/
if
(
test_thread_flag
(
TIF_RESTORE_SIGMASK
))
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
/*
* Let tracing know that we've done the handler setup.
*/
tracehook_signal_handler
(
signr
,
&
info
,
&
ka
,
regs
,
test_thread_flag
(
TIF_SINGLE_STEP
));
}
return
;
return
;
}
}
...
...
arch/score/kernel/signal.c
View file @
a610d6e6
...
@@ -241,11 +241,9 @@ static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
...
@@ -241,11 +241,9 @@ static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
return
-
EFAULT
;
return
-
EFAULT
;
}
}
static
int
handle_signal
(
unsigned
long
sig
,
siginfo_t
*
info
,
static
void
handle_signal
(
unsigned
long
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
)
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
)
{
{
int
ret
;
if
(
regs
->
is_syscall
)
{
if
(
regs
->
is_syscall
)
{
switch
(
regs
->
regs
[
4
])
{
switch
(
regs
->
regs
[
4
])
{
case
ERESTART_RESTARTBLOCK
:
case
ERESTART_RESTARTBLOCK
:
...
@@ -269,12 +267,10 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
...
@@ -269,12 +267,10 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
/*
/*
* Set up the stack frame
* Set up the stack frame
*/
*/
ret
=
setup_rt_frame
(
ka
,
regs
,
sig
,
sigmask_to_save
(),
info
);
if
(
setup_rt_frame
(
ka
,
regs
,
sig
,
sigmask_to_save
(),
info
)
<
0
)
return
;
if
(
ret
==
0
)
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
return
ret
;
}
}
static
void
do_signal
(
struct
pt_regs
*
regs
)
static
void
do_signal
(
struct
pt_regs
*
regs
)
...
@@ -294,17 +290,7 @@ static void do_signal(struct pt_regs *regs)
...
@@ -294,17 +290,7 @@ static void do_signal(struct pt_regs *regs)
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
if
(
signr
>
0
)
{
if
(
signr
>
0
)
{
/* Actually deliver the signal. */
/* Actually deliver the signal. */
if
(
handle_signal
(
signr
,
&
info
,
&
ka
,
regs
)
==
0
)
{
handle_signal
(
signr
,
&
info
,
&
ka
,
regs
);
/*
* A signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TIF_RESTORE_SIGMASK flag.
*/
if
(
test_thread_flag
(
TIF_RESTORE_SIGMASK
))
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
}
return
;
return
;
}
}
...
...
arch/sh/kernel/signal_32.c
View file @
a610d6e6
...
@@ -522,7 +522,7 @@ handle_syscall_restart(unsigned long save_r0, struct pt_regs *regs,
...
@@ -522,7 +522,7 @@ handle_syscall_restart(unsigned long save_r0, struct pt_regs *regs,
/*
/*
* OK, we're invoking a handler
* OK, we're invoking a handler
*/
*/
static
int
static
void
handle_signal
(
unsigned
long
sig
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
handle_signal
(
unsigned
long
sig
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
struct
pt_regs
*
regs
,
unsigned
int
save_r0
)
struct
pt_regs
*
regs
,
unsigned
int
save_r0
)
{
{
...
@@ -535,10 +535,11 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
...
@@ -535,10 +535,11 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
else
else
ret
=
setup_frame
(
sig
,
ka
,
oldset
,
regs
);
ret
=
setup_frame
(
sig
,
ka
,
oldset
,
regs
);
if
(
ret
==
0
)
if
(
ret
)
return
;
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
tracehook_signal_handler
(
sig
,
info
,
ka
,
regs
,
return
ret
;
test_thread_flag
(
TIF_SINGLESTEP
))
;
}
}
/*
/*
...
@@ -570,20 +571,7 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)
...
@@ -570,20 +571,7 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)
handle_syscall_restart
(
save_r0
,
regs
,
&
ka
.
sa
);
handle_syscall_restart
(
save_r0
,
regs
,
&
ka
.
sa
);
/* Whee! Actually deliver the signal. */
/* Whee! Actually deliver the signal. */
if
(
handle_signal
(
signr
,
&
ka
,
&
info
,
handle_signal
(
signr
,
&
ka
,
&
info
,
regs
,
save_r0
);
regs
,
save_r0
)
==
0
)
{
/*
* A signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TS_RESTORE_SIGMASK flag
*/
current_thread_info
()
->
status
&=
~
TS_RESTORE_SIGMASK
;
tracehook_signal_handler
(
signr
,
&
info
,
&
ka
,
regs
,
test_thread_flag
(
TIF_SINGLESTEP
));
}
return
;
return
;
}
}
...
...
arch/sh/kernel/signal_64.c
View file @
a610d6e6
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
static
int
static
void
handle_signal
(
unsigned
long
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
handle_signal
(
unsigned
long
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
);
struct
pt_regs
*
regs
);
...
@@ -103,17 +103,7 @@ static void do_signal(struct pt_regs *regs)
...
@@ -103,17 +103,7 @@ static void do_signal(struct pt_regs *regs)
handle_syscall_restart
(
regs
,
&
ka
.
sa
);
handle_syscall_restart
(
regs
,
&
ka
.
sa
);
/* Whee! Actually deliver the signal. */
/* Whee! Actually deliver the signal. */
if
(
handle_signal
(
signr
,
&
info
,
&
ka
,
regs
)
==
0
)
{
handle_signal
(
signr
,
&
info
,
&
ka
,
regs
);
/*
* If a signal was successfully delivered, the
* saved sigmask is in its frame, and we can
* clear the TS_RESTORE_SIGMASK flag.
*/
current_thread_info
()
->
status
&=
~
TS_RESTORE_SIGMASK
;
tracehook_signal_handler
(
signr
,
&
info
,
&
ka
,
regs
,
test_thread_flag
(
TIF_SINGLESTEP
));
}
return
;
return
;
}
}
...
@@ -648,7 +638,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
...
@@ -648,7 +638,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
/*
/*
* OK, we're invoking a handler
* OK, we're invoking a handler
*/
*/
static
int
static
void
handle_signal
(
unsigned
long
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
handle_signal
(
unsigned
long
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
)
struct
pt_regs
*
regs
)
{
{
...
@@ -661,10 +651,12 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
...
@@ -661,10 +651,12 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
else
else
ret
=
setup_frame
(
sig
,
ka
,
oldset
,
regs
);
ret
=
setup_frame
(
sig
,
ka
,
oldset
,
regs
);
if
(
ret
==
0
)
if
(
ret
)
block_sigmask
(
ka
,
sig
)
;
return
;
return
ret
;
block_sigmask
(
ka
,
sig
);
tracehook_signal_handler
(
sig
,
info
,
ka
,
regs
,
test_thread_flag
(
TIF_SINGLESTEP
));
}
}
asmlinkage
void
do_notify_resume
(
struct
pt_regs
*
regs
,
unsigned
long
thread_info_flags
)
asmlinkage
void
do_notify_resume
(
struct
pt_regs
*
regs
,
unsigned
long
thread_info_flags
)
...
...
arch/sparc/kernel/signal32.c
View file @
a610d6e6
...
@@ -775,7 +775,7 @@ static int setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs,
...
@@ -775,7 +775,7 @@ static int setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs,
return
-
EFAULT
;
return
-
EFAULT
;
}
}
static
inline
int
handle_signal32
(
unsigned
long
signr
,
struct
k_sigaction
*
ka
,
static
inline
void
handle_signal32
(
unsigned
long
signr
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
siginfo_t
*
info
,
sigset_t
*
oldset
,
struct
pt_regs
*
regs
)
sigset_t
*
oldset
,
struct
pt_regs
*
regs
)
{
{
...
@@ -787,12 +787,10 @@ static inline int handle_signal32(unsigned long signr, struct k_sigaction *ka,
...
@@ -787,12 +787,10 @@ static inline int handle_signal32(unsigned long signr, struct k_sigaction *ka,
err
=
setup_frame32
(
ka
,
regs
,
signr
,
oldset
);
err
=
setup_frame32
(
ka
,
regs
,
signr
,
oldset
);
if
(
err
)
if
(
err
)
return
err
;
return
;
block_sigmask
(
ka
,
signr
);
block_sigmask
(
ka
,
signr
);
tracehook_signal_handler
(
signr
,
info
,
ka
,
regs
,
0
);
tracehook_signal_handler
(
signr
,
info
,
ka
,
regs
,
0
);
return
0
;
}
}
static
inline
void
syscall_restart32
(
unsigned
long
orig_i0
,
struct
pt_regs
*
regs
,
static
inline
void
syscall_restart32
(
unsigned
long
orig_i0
,
struct
pt_regs
*
regs
,
...
@@ -841,14 +839,7 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs)
...
@@ -841,14 +839,7 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs)
if
(
signr
>
0
)
{
if
(
signr
>
0
)
{
if
(
restart_syscall
)
if
(
restart_syscall
)
syscall_restart32
(
orig_i0
,
regs
,
&
ka
.
sa
);
syscall_restart32
(
orig_i0
,
regs
,
&
ka
.
sa
);
if
(
handle_signal32
(
signr
,
&
ka
,
&
info
,
oldset
,
regs
)
==
0
)
{
handle_signal32
(
signr
,
&
ka
,
&
info
,
oldset
,
regs
);
/* A signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TS_RESTORE_SIGMASK flag.
*/
current_thread_info
()
->
status
&=
~
TS_RESTORE_SIGMASK
;
}
return
;
return
;
}
}
if
(
restart_syscall
&&
if
(
restart_syscall
&&
...
...
arch/sparc/kernel/signal_32.c
View file @
a610d6e6
...
@@ -449,7 +449,7 @@ static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
...
@@ -449,7 +449,7 @@ static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
return
-
EFAULT
;
return
-
EFAULT
;
}
}
static
inline
int
static
inline
void
handle_signal
(
unsigned
long
signr
,
struct
k_sigaction
*
ka
,
handle_signal
(
unsigned
long
signr
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
struct
pt_regs
*
regs
)
siginfo_t
*
info
,
struct
pt_regs
*
regs
)
{
{
...
@@ -462,12 +462,10 @@ handle_signal(unsigned long signr, struct k_sigaction *ka,
...
@@ -462,12 +462,10 @@ handle_signal(unsigned long signr, struct k_sigaction *ka,
err
=
setup_frame
(
ka
,
regs
,
signr
,
oldset
);
err
=
setup_frame
(
ka
,
regs
,
signr
,
oldset
);
if
(
err
)
if
(
err
)
return
err
;
return
;
block_sigmask
(
ka
,
signr
);
block_sigmask
(
ka
,
signr
);
tracehook_signal_handler
(
signr
,
info
,
ka
,
regs
,
0
);
tracehook_signal_handler
(
signr
,
info
,
ka
,
regs
,
0
);
return
0
;
}
}
static
inline
void
syscall_restart
(
unsigned
long
orig_i0
,
struct
pt_regs
*
regs
,
static
inline
void
syscall_restart
(
unsigned
long
orig_i0
,
struct
pt_regs
*
regs
,
...
@@ -539,15 +537,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
...
@@ -539,15 +537,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
if
(
signr
>
0
)
{
if
(
signr
>
0
)
{
if
(
restart_syscall
)
if
(
restart_syscall
)
syscall_restart
(
orig_i0
,
regs
,
&
ka
.
sa
);
syscall_restart
(
orig_i0
,
regs
,
&
ka
.
sa
);
if
(
handle_signal
(
signr
,
&
ka
,
&
info
,
regs
)
==
0
)
{
handle_signal
(
signr
,
&
ka
,
&
info
,
regs
);
/* a signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TIF_RESTORE_SIGMASK flag.
*/
if
(
test_thread_flag
(
TIF_RESTORE_SIGMASK
))
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
}
return
;
return
;
}
}
if
(
restart_syscall
&&
if
(
restart_syscall
&&
...
...
arch/sparc/kernel/signal_64.c
View file @
a610d6e6
...
@@ -466,7 +466,7 @@ setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
...
@@ -466,7 +466,7 @@ setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
return
-
EFAULT
;
return
-
EFAULT
;
}
}
static
inline
int
handle_signal
(
unsigned
long
signr
,
struct
k_sigaction
*
ka
,
static
inline
void
handle_signal
(
unsigned
long
signr
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
siginfo_t
*
info
,
sigset_t
*
oldset
,
struct
pt_regs
*
regs
)
sigset_t
*
oldset
,
struct
pt_regs
*
regs
)
{
{
...
@@ -475,12 +475,10 @@ static inline int handle_signal(unsigned long signr, struct k_sigaction *ka,
...
@@ -475,12 +475,10 @@ static inline int handle_signal(unsigned long signr, struct k_sigaction *ka,
err
=
setup_rt_frame
(
ka
,
regs
,
signr
,
oldset
,
err
=
setup_rt_frame
(
ka
,
regs
,
signr
,
oldset
,
(
ka
->
sa
.
sa_flags
&
SA_SIGINFO
)
?
info
:
NULL
);
(
ka
->
sa
.
sa_flags
&
SA_SIGINFO
)
?
info
:
NULL
);
if
(
err
)
if
(
err
)
return
err
;
return
;
block_sigmask
(
ka
,
signr
);
block_sigmask
(
ka
,
signr
);
tracehook_signal_handler
(
signr
,
info
,
ka
,
regs
,
0
);
tracehook_signal_handler
(
signr
,
info
,
ka
,
regs
,
0
);
return
0
;
}
}
static
inline
void
syscall_restart
(
unsigned
long
orig_i0
,
struct
pt_regs
*
regs
,
static
inline
void
syscall_restart
(
unsigned
long
orig_i0
,
struct
pt_regs
*
regs
,
...
@@ -558,14 +556,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
...
@@ -558,14 +556,7 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0)
if
(
signr
>
0
)
{
if
(
signr
>
0
)
{
if
(
restart_syscall
)
if
(
restart_syscall
)
syscall_restart
(
orig_i0
,
regs
,
&
ka
.
sa
);
syscall_restart
(
orig_i0
,
regs
,
&
ka
.
sa
);
if
(
handle_signal
(
signr
,
&
ka
,
&
info
,
oldset
,
regs
)
==
0
)
{
handle_signal
(
signr
,
&
ka
,
&
info
,
oldset
,
regs
);
/* A signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TS_RESTORE_SIGMASK flag.
*/
current_thread_info
()
->
status
&=
~
TS_RESTORE_SIGMASK
;
}
return
;
return
;
}
}
if
(
restart_syscall
&&
if
(
restart_syscall
&&
...
...
arch/tile/kernel/signal.c
View file @
a610d6e6
...
@@ -242,7 +242,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
...
@@ -242,7 +242,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
* OK, we're invoking a handler
* OK, we're invoking a handler
*/
*/
static
int
handle_signal
(
unsigned
long
sig
,
siginfo_t
*
info
,
static
void
handle_signal
(
unsigned
long
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
)
struct
pt_regs
*
regs
)
{
{
...
@@ -279,15 +279,9 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
...
@@ -279,15 +279,9 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
else
else
#endif
#endif
ret
=
setup_rt_frame
(
sig
,
ka
,
info
,
oldset
,
regs
);
ret
=
setup_rt_frame
(
sig
,
ka
,
info
,
oldset
,
regs
);
if
(
ret
==
0
)
{
if
(
ret
)
/* This code is only called from system calls or from
return
;
* the work_pending path in the return-to-user code, and
* either way we can re-enable interrupts unconditionally.
*/
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
}
return
ret
;
}
}
/*
/*
...
@@ -311,16 +305,7 @@ void do_signal(struct pt_regs *regs)
...
@@ -311,16 +305,7 @@ void do_signal(struct pt_regs *regs)
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
if
(
signr
>
0
)
{
if
(
signr
>
0
)
{
/* Whee! Actually deliver the signal. */
/* Whee! Actually deliver the signal. */
if
(
handle_signal
(
signr
,
&
info
,
&
ka
,
regs
)
==
0
)
{
handle_signal
(
signr
,
&
info
,
&
ka
,
regs
);
/*
* A signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TS_RESTORE_SIGMASK flag.
*/
current_thread_info
()
->
status
&=
~
TS_RESTORE_SIGMASK
;
}
goto
done
;
goto
done
;
}
}
...
...
arch/um/kernel/signal.c
View file @
a610d6e6
...
@@ -22,7 +22,7 @@ EXPORT_SYMBOL(unblock_signals);
...
@@ -22,7 +22,7 @@ EXPORT_SYMBOL(unblock_signals);
/*
/*
* OK, we're invoking a handler
* OK, we're invoking a handler
*/
*/
static
int
handle_signal
(
struct
pt_regs
*
regs
,
unsigned
long
signr
,
static
void
handle_signal
(
struct
pt_regs
*
regs
,
unsigned
long
signr
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
)
struct
k_sigaction
*
ka
,
siginfo_t
*
info
)
{
{
sigset_t
*
oldset
=
sigmask_to_save
();
sigset_t
*
oldset
=
sigmask_to_save
();
...
@@ -66,8 +66,6 @@ static int handle_signal(struct pt_regs *regs, unsigned long signr,
...
@@ -66,8 +66,6 @@ static int handle_signal(struct pt_regs *regs, unsigned long signr,
force_sigsegv
(
signr
,
current
);
force_sigsegv
(
signr
,
current
);
else
else
block_sigmask
(
ka
,
signr
);
block_sigmask
(
ka
,
signr
);
return
err
;
}
}
static
int
kern_do_signal
(
struct
pt_regs
*
regs
)
static
int
kern_do_signal
(
struct
pt_regs
*
regs
)
...
@@ -79,17 +77,7 @@ static int kern_do_signal(struct pt_regs *regs)
...
@@ -79,17 +77,7 @@ static int kern_do_signal(struct pt_regs *regs)
while
((
sig
=
get_signal_to_deliver
(
&
info
,
&
ka_copy
,
regs
,
NULL
))
>
0
)
{
while
((
sig
=
get_signal_to_deliver
(
&
info
,
&
ka_copy
,
regs
,
NULL
))
>
0
)
{
handled_sig
=
1
;
handled_sig
=
1
;
/* Whee! Actually deliver the signal. */
/* Whee! Actually deliver the signal. */
if
(
!
handle_signal
(
regs
,
sig
,
&
ka_copy
,
&
info
))
{
handle_signal
(
regs
,
sig
,
&
ka_copy
,
&
info
);
/*
* a signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TIF_RESTORE_SIGMASK flag
*/
if
(
test_thread_flag
(
TIF_RESTORE_SIGMASK
))
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
break
;
}
}
}
/* Did we come from a system call? */
/* Did we come from a system call? */
...
...
arch/unicore32/kernel/signal.c
View file @
a610d6e6
...
@@ -312,7 +312,7 @@ static inline void setup_syscall_restart(struct pt_regs *regs)
...
@@ -312,7 +312,7 @@ static inline void setup_syscall_restart(struct pt_regs *regs)
/*
/*
* OK, we're invoking a handler
* OK, we're invoking a handler
*/
*/
static
int
handle_signal
(
unsigned
long
sig
,
struct
k_sigaction
*
ka
,
static
void
handle_signal
(
unsigned
long
sig
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
struct
pt_regs
*
regs
,
int
syscall
)
siginfo_t
*
info
,
struct
pt_regs
*
regs
,
int
syscall
)
{
{
struct
thread_info
*
thread
=
current_thread_info
();
struct
thread_info
*
thread
=
current_thread_info
();
...
@@ -363,15 +363,13 @@ static int handle_signal(unsigned long sig, struct k_sigaction *ka,
...
@@ -363,15 +363,13 @@ static int handle_signal(unsigned long sig, struct k_sigaction *ka,
if
(
ret
!=
0
)
{
if
(
ret
!=
0
)
{
force_sigsegv
(
sig
,
tsk
);
force_sigsegv
(
sig
,
tsk
);
return
ret
;
return
;
}
}
/*
/*
* Block the signal if we were successful.
* Block the signal if we were successful.
*/
*/
block_sigmask
(
ka
,
sig
);
block_sigmask
(
ka
,
sig
);
return
0
;
}
}
/*
/*
...
@@ -403,17 +401,7 @@ static void do_signal(struct pt_regs *regs, int syscall)
...
@@ -403,17 +401,7 @@ static void do_signal(struct pt_regs *regs, int syscall)
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
if
(
signr
>
0
)
{
if
(
signr
>
0
)
{
if
(
handle_signal
(
signr
,
&
ka
,
&
info
,
regs
,
syscall
)
handle_signal
(
signr
,
&
ka
,
&
info
,
regs
,
syscall
);
==
0
)
{
/*
* A signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TIF_RESTORE_SIGMASK flag.
*/
if
(
test_thread_flag
(
TIF_RESTORE_SIGMASK
))
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
}
return
;
return
;
}
}
...
...
arch/x86/kernel/signal.c
View file @
a610d6e6
...
@@ -648,38 +648,27 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
...
@@ -648,38 +648,27 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
{
{
int
usig
=
signr_convert
(
sig
);
int
usig
=
signr_convert
(
sig
);
sigset_t
*
set
=
sigmask_to_save
();
sigset_t
*
set
=
sigmask_to_save
();
int
ret
;
/* Set up the stack frame */
/* Set up the stack frame */
if
(
is_ia32
)
{
if
(
is_ia32
)
{
if
(
ka
->
sa
.
sa_flags
&
SA_SIGINFO
)
if
(
ka
->
sa
.
sa_flags
&
SA_SIGINFO
)
ret
=
ia32_setup_rt_frame
(
usig
,
ka
,
info
,
set
,
regs
);
ret
urn
ia32_setup_rt_frame
(
usig
,
ka
,
info
,
set
,
regs
);
else
else
ret
=
ia32_setup_frame
(
usig
,
ka
,
set
,
regs
);
ret
urn
ia32_setup_frame
(
usig
,
ka
,
set
,
regs
);
#ifdef CONFIG_X86_X32_ABI
#ifdef CONFIG_X86_X32_ABI
}
else
if
(
is_x32
)
{
}
else
if
(
is_x32
)
{
ret
=
x32_setup_rt_frame
(
usig
,
ka
,
info
,
ret
urn
x32_setup_rt_frame
(
usig
,
ka
,
info
,
(
compat_sigset_t
*
)
set
,
regs
);
(
compat_sigset_t
*
)
set
,
regs
);
#endif
#endif
}
else
{
}
else
{
ret
=
__setup_rt_frame
(
sig
,
ka
,
info
,
set
,
regs
);
ret
urn
__setup_rt_frame
(
sig
,
ka
,
info
,
set
,
regs
);
}
}
if
(
ret
)
{
force_sigsegv
(
sig
,
current
);
return
-
EFAULT
;
}
current_thread_info
()
->
status
&=
~
TS_RESTORE_SIGMASK
;
return
ret
;
}
}
static
int
static
void
handle_signal
(
unsigned
long
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
handle_signal
(
unsigned
long
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
)
struct
pt_regs
*
regs
)
{
{
int
ret
;
/* Are we from a system call? */
/* Are we from a system call? */
if
(
syscall_get_nr
(
current
,
regs
)
>=
0
)
{
if
(
syscall_get_nr
(
current
,
regs
)
>=
0
)
{
/* If so, check system call restarting.. */
/* If so, check system call restarting.. */
...
@@ -710,10 +699,10 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
...
@@ -710,10 +699,10 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
likely
(
test_and_clear_thread_flag
(
TIF_FORCED_TF
)))
likely
(
test_and_clear_thread_flag
(
TIF_FORCED_TF
)))
regs
->
flags
&=
~
X86_EFLAGS_TF
;
regs
->
flags
&=
~
X86_EFLAGS_TF
;
ret
=
setup_rt_frame
(
sig
,
ka
,
info
,
regs
);
if
(
setup_rt_frame
(
sig
,
ka
,
info
,
regs
)
<
0
)
{
force_sigsegv
(
sig
,
current
);
if
(
ret
)
return
;
return
ret
;
}
/*
/*
* Clear the direction flag as per the ABI for function entry.
* Clear the direction flag as per the ABI for function entry.
...
@@ -732,8 +721,6 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
...
@@ -732,8 +721,6 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
tracehook_signal_handler
(
sig
,
info
,
ka
,
regs
,
tracehook_signal_handler
(
sig
,
info
,
ka
,
regs
,
test_thread_flag
(
TIF_SINGLESTEP
));
test_thread_flag
(
TIF_SINGLESTEP
));
return
0
;
}
}
#ifdef CONFIG_X86_32
#ifdef CONFIG_X86_32
...
...
arch/xtensa/kernel/signal.c
View file @
a610d6e6
...
@@ -499,7 +499,6 @@ static void do_signal(struct pt_regs *regs)
...
@@ -499,7 +499,6 @@ static void do_signal(struct pt_regs *regs)
if
(
ret
)
if
(
ret
)
return
;
return
;
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
block_sigmask
(
&
ka
,
signr
);
block_sigmask
(
&
ka
,
signr
);
if
(
current
->
ptrace
&
PT_SINGLESTEP
)
if
(
current
->
ptrace
&
PT_SINGLESTEP
)
task_pt_regs
(
current
)
->
icountlevel
=
1
;
task_pt_regs
(
current
)
->
icountlevel
=
1
;
...
...
kernel/signal.c
View file @
a610d6e6
...
@@ -2382,6 +2382,12 @@ void block_sigmask(struct k_sigaction *ka, int signr)
...
@@ -2382,6 +2382,12 @@ void block_sigmask(struct k_sigaction *ka, int signr)
{
{
sigset_t
blocked
;
sigset_t
blocked
;
/* A signal was successfully delivered, and the
saved sigmask was stored on the signal frame,
and will be restored by sigreturn. So we can
simply clear the restore sigmask flag. */
clear_restore_sigmask
();
sigorsets
(
&
blocked
,
&
current
->
blocked
,
&
ka
->
sa
.
sa_mask
);
sigorsets
(
&
blocked
,
&
current
->
blocked
,
&
ka
->
sa
.
sa_mask
);
if
(
!
(
ka
->
sa
.
sa_flags
&
SA_NODEFER
))
if
(
!
(
ka
->
sa
.
sa_flags
&
SA_NODEFER
))
sigaddset
(
&
blocked
,
signr
);
sigaddset
(
&
blocked
,
signr
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment