projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a27e5a1
)
[IA64] sync compat getdents
author
Alexandr Andreev
<
[email protected]
>
Tue, 6 Mar 2007 10:34:24 +0000
(
02:34
-0800)
committer
Tony Luck
<
[email protected]
>
Tue, 6 Mar 2007 22:49:24 +0000
(14:49 -0800)
Add VERIFY_WRITE check in the beginning like compat_sys_getdents() (EINVAL vs
EFAULT).
Signed-off-by: Alexandr Andreev <
[email protected]
>
Signed-off-by: Alexey Dobriyan <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Tony Luck <
[email protected]
>
arch/ia64/ia32/sys_ia32.c
patch
|
blob
|
history
diff --git
a/arch/ia64/ia32/sys_ia32.c
b/arch/ia64/ia32/sys_ia32.c
index d430d36ae49d62763757d05c354ec4590781d6da..0afb4fe7c35b8bfeff14d1aebd0e892a7a1a1d64 100644
(file)
--- a/
arch/ia64/ia32/sys_ia32.c
+++ b/
arch/ia64/ia32/sys_ia32.c
@@
-1267,6
+1267,10
@@
sys32_getdents (unsigned int fd, struct compat_dirent __user *dirent, unsigned i
struct getdents32_callback buf;
int error;
+ error = -EFAULT;
+ if (!access_ok(VERIFY_WRITE, dirent, count))
+ goto out;
+
error = -EBADF;
file = fget(fd);
if (!file)
@@
-1283,10
+1287,10
@@
sys32_getdents (unsigned int fd, struct compat_dirent __user *dirent, unsigned i
error = buf.error;
lastdirent = buf.previous;
if (lastdirent) {
- error = -EINVAL;
if (put_user(file->f_pos, &lastdirent->d_off))
- goto out_putf;
- error = count - buf.count;
+ error = -EFAULT;
+ else
+ error = count - buf.count;
}
out_putf: