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
0f95ec58
Commit
0f95ec58
authored
Apr 09, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Annotate kernel/ptrace.c with user pointer information
parent
9fde1f47
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
kernel/ptrace.c
kernel/ptrace.c
+9
-10
No files found.
kernel/ptrace.c
View file @
0f95ec58
...
...
@@ -200,7 +200,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in
return
buf
-
old_buf
;
}
int
ptrace_readdata
(
struct
task_struct
*
tsk
,
unsigned
long
src
,
char
*
dst
,
int
len
)
int
ptrace_readdata
(
struct
task_struct
*
tsk
,
unsigned
long
src
,
char
__user
*
dst
,
int
len
)
{
int
copied
=
0
;
...
...
@@ -225,7 +225,7 @@ int ptrace_readdata(struct task_struct *tsk, unsigned long src, char *dst, int l
return
copied
;
}
int
ptrace_writedata
(
struct
task_struct
*
tsk
,
char
*
src
,
unsigned
long
dst
,
int
len
)
int
ptrace_writedata
(
struct
task_struct
*
tsk
,
char
__user
*
src
,
unsigned
long
dst
,
int
len
)
{
int
copied
=
0
;
...
...
@@ -278,19 +278,18 @@ static int ptrace_setoptions(struct task_struct *child, long data)
return
(
data
&
~
PTRACE_O_MASK
)
?
-
EINVAL
:
0
;
}
static
int
ptrace_getsiginfo
(
struct
task_struct
*
child
,
long
data
)
static
int
ptrace_getsiginfo
(
struct
task_struct
*
child
,
siginfo_t
__user
*
data
)
{
if
(
child
->
last_siginfo
==
NULL
)
return
-
EINVAL
;
return
copy_siginfo_to_user
((
siginfo_t
*
)
data
,
child
->
last_siginfo
);
return
copy_siginfo_to_user
(
data
,
child
->
last_siginfo
);
}
static
int
ptrace_setsiginfo
(
struct
task_struct
*
child
,
long
data
)
static
int
ptrace_setsiginfo
(
struct
task_struct
*
child
,
siginfo_t
__user
*
data
)
{
if
(
child
->
last_siginfo
==
NULL
)
return
-
EINVAL
;
if
(
copy_from_user
(
child
->
last_siginfo
,
(
siginfo_t
*
)
data
,
sizeof
(
siginfo_t
))
!=
0
)
if
(
copy_from_user
(
child
->
last_siginfo
,
data
,
sizeof
(
siginfo_t
))
!=
0
)
return
-
EFAULT
;
return
0
;
}
...
...
@@ -308,13 +307,13 @@ int ptrace_request(struct task_struct *child, long request,
ret
=
ptrace_setoptions
(
child
,
data
);
break
;
case
PTRACE_GETEVENTMSG
:
ret
=
put_user
(
child
->
ptrace_message
,
(
unsigned
long
*
)
data
);
ret
=
put_user
(
child
->
ptrace_message
,
(
unsigned
long
__user
*
)
data
);
break
;
case
PTRACE_GETSIGINFO
:
ret
=
ptrace_getsiginfo
(
child
,
data
);
ret
=
ptrace_getsiginfo
(
child
,
(
siginfo_t
__user
*
)
data
);
break
;
case
PTRACE_SETSIGINFO
:
ret
=
ptrace_setsiginfo
(
child
,
data
);
ret
=
ptrace_setsiginfo
(
child
,
(
siginfo_t
__user
*
)
data
);
break
;
default:
break
;
...
...
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