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
...
@@ -72,11 +72,16 @@ static int fillonedir(void * __buf, const char * name, int namlen, loff_t offset
return
-
EINVAL
;
return
-
EINVAL
;
buf
->
count
++
;
buf
->
count
++
;
dirent
=
buf
->
dirent
;
dirent
=
buf
->
dirent
;
put_user
(
ino
,
&
dirent
->
d_ino
);
if
(
!
access_ok
(
VERIFY_WRITE
,
(
unsigned
long
)
dirent
,
put_user
(
offset
,
&
dirent
->
d_offset
);
(
unsigned
long
)(
dirent
->
d_name
+
namlen
+
1
)
-
put_user
(
namlen
,
&
dirent
->
d_namlen
);
(
unsigned
long
)
dirent
))
copy_to_user
(
dirent
->
d_name
,
name
,
namlen
);
return
-
EFAULT
;
put_user
(
0
,
dirent
->
d_name
+
namlen
);
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
;
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