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
Kirill Smelkov
linux
Commits
fccd7b34
Commit
fccd7b34
authored
Apr 16, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sparc{,64}: On PTRACEd processes, do the syscall restart before
we notify the parent.
parent
ab4d28ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
15 deletions
+59
-15
arch/sparc/kernel/signal.c
arch/sparc/kernel/signal.c
+27
-13
arch/sparc64/kernel/signal.c
arch/sparc64/kernel/signal.c
+16
-1
arch/sparc64/kernel/signal32.c
arch/sparc64/kernel/signal32.c
+16
-1
No files found.
arch/sparc/kernel/signal.c
View file @
fccd7b34
...
...
@@ -1173,9 +1173,23 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs,
signr
=
dequeue_signal
(
&
current
->
blocked
,
&
info
);
spin_unlock_irq
(
&
current
->
sigmask_lock
);
if
(
!
signr
)
break
;
if
(
!
signr
)
break
;
if
((
current
->
ptrace
&
PT_PTRACED
)
&&
signr
!=
SIGKILL
)
{
/* Do the syscall restart before we let the debugger
* look at the child registers.
*/
if
(
restart_syscall
&&
(
regs
->
u_regs
[
UREG_I0
]
==
ERESTARTNOHAND
||
regs
->
u_regs
[
UREG_I0
]
==
ERESTARTSYS
||
regs
->
u_regs
[
UREG_I0
]
==
ERESTARTNOINTR
))
{
/* replay the system call when we are done */
regs
->
u_regs
[
UREG_I0
]
=
orig_i0
;
regs
->
pc
-=
4
;
regs
->
npc
-=
4
;
restart_syscall
=
0
;
}
current
->
exit_code
=
signr
;
current
->
state
=
TASK_STOPPED
;
...
...
@@ -1208,8 +1222,8 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs,
ka
=
&
current
->
sig
->
action
[
signr
-
1
];
if
(
ka
->
sa
.
sa_handler
==
SIG_IGN
)
{
if
(
signr
!=
SIGCHLD
)
if
(
ka
->
sa
.
sa_handler
==
SIG_IGN
)
{
if
(
signr
!=
SIGCHLD
)
continue
;
/* sys_wait4() grabs the master kernel lock, so
...
...
@@ -1221,12 +1235,12 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs,
;
continue
;
}
if
(
ka
->
sa
.
sa_handler
==
SIG_DFL
)
{
if
(
ka
->
sa
.
sa_handler
==
SIG_DFL
)
{
unsigned
long
exit_code
=
signr
;
if
(
current
->
pid
==
1
)
if
(
current
->
pid
==
1
)
continue
;
switch
(
signr
)
{
switch
(
signr
)
{
case
SIGCONT
:
case
SIGCHLD
:
case
SIGWINCH
:
continue
;
...
...
@@ -1265,8 +1279,8 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs,
struct
reg_window
*
rw
=
(
struct
reg_window
*
)
regs
->
u_regs
[
UREG_FP
];
unsigned
int
ins
[
8
];
while
(
rw
&&
!
(((
unsigned
long
)
rw
)
&
0x3
))
{
while
(
rw
&&
!
(((
unsigned
long
)
rw
)
&
0x3
))
{
copy_from_user
(
ins
,
&
rw
->
ins
[
0
],
sizeof
(
ins
));
printk
(
"Caller[%08x](%08x,%08x,%08x,%08x,%08x,%08x)
\n
"
,
ins
[
7
],
ins
[
0
],
ins
[
1
],
ins
[
2
],
ins
[
3
],
ins
[
4
],
ins
[
5
]);
rw
=
(
struct
reg_window
*
)(
unsigned
long
)
ins
[
6
];
...
...
@@ -1287,15 +1301,15 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs,
/* NOT REACHED */
}
}
if
(
restart_syscall
)
if
(
restart_syscall
)
syscall_restart
(
orig_i0
,
regs
,
&
ka
->
sa
);
handle_signal
(
signr
,
ka
,
&
info
,
oldset
,
regs
,
svr4_signal
);
return
1
;
}
if
(
restart_syscall
&&
(
regs
->
u_regs
[
UREG_I0
]
==
ERESTARTNOHAND
||
regs
->
u_regs
[
UREG_I0
]
==
ERESTARTSYS
||
regs
->
u_regs
[
UREG_I0
]
==
ERESTARTNOINTR
))
{
if
(
restart_syscall
&&
(
regs
->
u_regs
[
UREG_I0
]
==
ERESTARTNOHAND
||
regs
->
u_regs
[
UREG_I0
]
==
ERESTARTSYS
||
regs
->
u_regs
[
UREG_I0
]
==
ERESTARTNOINTR
))
{
/* replay the system call when we are done */
regs
->
u_regs
[
UREG_I0
]
=
orig_i0
;
regs
->
pc
-=
4
;
...
...
arch/sparc64/kernel/signal.c
View file @
fccd7b34
...
...
@@ -709,9 +709,24 @@ static int do_signal(sigset_t *oldset, struct pt_regs * regs,
signr
=
dequeue_signal
(
&
current
->
blocked
,
&
info
);
spin_unlock_irq
(
&
current
->
sigmask_lock
);
if
(
!
signr
)
break
;
if
(
!
signr
)
break
;
if
((
current
->
ptrace
&
PT_PTRACED
)
&&
signr
!=
SIGKILL
)
{
/* Do the syscall restart before we let the debugger
* look at the child registers.
*/
if
(
restart_syscall
&&
(
regs
->
u_regs
[
UREG_I0
]
==
ERESTARTNOHAND
||
regs
->
u_regs
[
UREG_I0
]
==
ERESTARTSYS
||
regs
->
u_regs
[
UREG_I0
]
==
ERESTARTNOINTR
))
{
/* replay the system call when we are done */
regs
->
u_regs
[
UREG_I0
]
=
orig_i0
;
regs
->
tpc
-=
4
;
regs
->
tnpc
-=
4
;
restart_syscall
=
0
;
}
current
->
exit_code
=
signr
;
current
->
state
=
TASK_STOPPED
;
notify_parent
(
current
,
SIGCHLD
);
...
...
arch/sparc64/kernel/signal32.c
View file @
fccd7b34
...
...
@@ -1383,9 +1383,24 @@ int do_signal32(sigset_t *oldset, struct pt_regs * regs,
signr
=
dequeue_signal
(
&
current
->
blocked
,
&
info
);
spin_unlock_irq
(
&
current
->
sigmask_lock
);
if
(
!
signr
)
break
;
if
(
!
signr
)
break
;
if
((
current
->
ptrace
&
PT_PTRACED
)
&&
signr
!=
SIGKILL
)
{
/* Do the syscall restart before we let the debugger
* look at the child registers.
*/
if
(
restart_syscall
&&
(
regs
->
u_regs
[
UREG_I0
]
==
ERESTARTNOHAND
||
regs
->
u_regs
[
UREG_I0
]
==
ERESTARTSYS
||
regs
->
u_regs
[
UREG_I0
]
==
ERESTARTNOINTR
))
{
/* replay the system call when we are done */
regs
->
u_regs
[
UREG_I0
]
=
orig_i0
;
regs
->
tpc
-=
4
;
regs
->
tnpc
-=
4
;
restart_syscall
=
0
;
}
current
->
exit_code
=
signr
;
current
->
state
=
TASK_STOPPED
;
notify_parent
(
current
,
SIGCHLD
);
...
...
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