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
4d580698
Commit
4d580698
authored
Mar 08, 2003
by
Andrew Morton
Committed by
James Bottomley
Mar 08, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] usercopy checks in old_readdir()
Fix up some unchecked copy_to_user()s
parent
de88f07f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
fs/readdir.c
fs/readdir.c
+10
-5
No files found.
fs/readdir.c
View file @
4d580698
...
...
@@ -72,11 +72,16 @@ static int fillonedir(void * __buf, const char * name, int namlen, loff_t offset
return
-
EINVAL
;
buf
->
count
++
;
dirent
=
buf
->
dirent
;
put_user
(
ino
,
&
dirent
->
d_ino
);
put_user
(
offset
,
&
dirent
->
d_offset
);
put_user
(
namlen
,
&
dirent
->
d_namlen
);
copy_to_user
(
dirent
->
d_name
,
name
,
namlen
);
put_user
(
0
,
dirent
->
d_name
+
namlen
);
if
(
!
access_ok
(
VERIFY_WRITE
,
(
unsigned
long
)
dirent
,
(
unsigned
long
)(
dirent
->
d_name
+
namlen
+
1
)
-
(
unsigned
long
)
dirent
))
return
-
EFAULT
;
if
(
__put_user
(
ino
,
&
dirent
->
d_ino
)
||
__put_user
(
offset
,
&
dirent
->
d_offset
)
||
__put_user
(
namlen
,
&
dirent
->
d_namlen
)
||
__copy_to_user
(
dirent
->
d_name
,
name
,
namlen
)
||
__put_user
(
0
,
dirent
->
d_name
+
namlen
))
return
-
EFAULT
;
return
0
;
}
...
...
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