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
bb646cdb
Commit
bb646cdb
authored
Dec 24, 2015
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proc_pid_attr_write(): switch to memdup_user()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
70f6cbb6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
fs/proc/base.c
fs/proc/base.c
+7
-10
No files found.
fs/proc/base.c
View file @
bb646cdb
...
...
@@ -2359,7 +2359,7 @@ static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf,
size_t
count
,
loff_t
*
ppos
)
{
struct
inode
*
inode
=
file_inode
(
file
);
char
*
page
;
void
*
page
;
ssize_t
length
;
struct
task_struct
*
task
=
get_proc_task
(
inode
);
...
...
@@ -2374,14 +2374,11 @@ static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf,
if
(
*
ppos
!=
0
)
goto
out
;
length
=
-
ENOMEM
;
page
=
(
char
*
)
__get_free_page
(
GFP_TEMPORARY
);
if
(
!
page
)
page
=
memdup_user
(
buf
,
count
)
;
if
(
IS_ERR
(
page
))
{
length
=
PTR_ERR
(
page
);
goto
out
;
length
=
-
EFAULT
;
if
(
copy_from_user
(
page
,
buf
,
count
))
goto
out_free
;
}
/* Guard against adverse ptrace interaction */
length
=
mutex_lock_interruptible
(
&
task
->
signal
->
cred_guard_mutex
);
...
...
@@ -2390,10 +2387,10 @@ static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf,
length
=
security_setprocattr
(
task
,
(
char
*
)
file
->
f_path
.
dentry
->
d_name
.
name
,
(
void
*
)
page
,
count
);
page
,
count
);
mutex_unlock
(
&
task
->
signal
->
cred_guard_mutex
);
out_free:
free_page
((
unsigned
long
)
page
);
kfree
(
page
);
out:
put_task_struct
(
task
);
out_no_task:
...
...
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