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
691785fa
Commit
691785fa
authored
Mar 18, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
On sparc{,64}, use ptrace_check_attach instead of
verifying things by hand.
parent
085c9a18
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
24 deletions
+11
-24
arch/sparc/kernel/ptrace.c
arch/sparc/kernel/ptrace.c
+6
-12
arch/sparc64/kernel/ptrace.c
arch/sparc64/kernel/ptrace.c
+5
-12
No files found.
arch/sparc/kernel/ptrace.c
View file @
691785fa
...
...
@@ -278,6 +278,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
unsigned
long
data
=
regs
->
u_regs
[
UREG_I3
];
unsigned
long
addr2
=
regs
->
u_regs
[
UREG_I4
];
struct
task_struct
*
child
;
int
ret
;
lock_kernel
();
#ifdef DEBUG_PTRACE
...
...
@@ -335,20 +336,13 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
pt_succ_return
(
regs
,
0
);
goto
out_tsk
;
}
if
(
!
(
child
->
ptrace
&
PT_PTRACED
))
{
pt_error_return
(
regs
,
ESRCH
);
goto
out_tsk
;
}
if
(
child
->
state
!=
TASK_STOPPED
)
{
if
(
request
!=
PTRACE_KILL
)
{
pt_error_return
(
regs
,
ESRCH
);
goto
out_tsk
;
}
}
if
(
child
->
p_pptr
!=
current
)
{
pt_error_return
(
regs
,
ESRCH
);
ret
=
ptrace_check_attach
(
child
,
request
==
PTRACE_KILL
);
if
(
ret
<
0
)
{
pt_error_return
(
regs
,
-
ret
);
goto
out_tsk
;
}
switch
(
request
)
{
case
PTRACE_PEEKTEXT
:
/* read word at location addr. */
case
PTRACE_PEEKDATA
:
{
...
...
arch/sparc64/kernel/ptrace.c
View file @
691785fa
...
...
@@ -122,6 +122,7 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
unsigned
long
data
=
regs
->
u_regs
[
UREG_I3
];
unsigned
long
addr2
=
regs
->
u_regs
[
UREG_I4
];
struct
task_struct
*
child
;
int
ret
;
if
(
test_thread_flag
(
TIF_32BIT
))
{
addr
&=
0xffffffffUL
;
...
...
@@ -184,18 +185,10 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
pt_succ_return
(
regs
,
0
);
goto
out_tsk
;
}
if
(
!
(
child
->
ptrace
&
PT_PTRACED
))
{
pt_error_return
(
regs
,
ESRCH
);
goto
out_tsk
;
}
if
(
child
->
state
!=
TASK_STOPPED
)
{
if
(
request
!=
PTRACE_KILL
)
{
pt_error_return
(
regs
,
ESRCH
);
goto
out_tsk
;
}
}
if
(
child
->
p_pptr
!=
current
)
{
pt_error_return
(
regs
,
ESRCH
);
ret
=
ptrace_check_attach
(
child
,
request
==
PTRACE_KILL
);
if
(
ret
<
0
)
{
pt_error_return
(
regs
,
-
ret
);
goto
out_tsk
;
}
...
...
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