aboutsummaryrefslogtreecommitdiff
path: root/arch/ia64/ia32/sys_ia32.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-06 18:05:10 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-06 18:05:10 -0800
commit1ba73b99c34c31ea18b44dcf161c6e1f2838e0fa (patch)
treeb0ce77589bdf5a860418181cf1704ba75d7fd415 /arch/ia64/ia32/sys_ia32.c
parent185d84b4e1f6febebbe30d785fe31310dcf9632a (diff)
parentcee87af2a5f75713b98d3e65e43872e547122cd5 (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6: [IA64] kexec: Use EFI_LOADER_DATA for ELF core header [IA64] permon use-after-free fix [IA64] sync compat getdents [IA64] always build arch/ia64/lib/xor.o [IA64] Remove stack hard limit on ia64 [IA64] point saved_max_pfn to the max_pfn of the entire system Revert "[IA64] swiotlb abstraction (e.g. for Xen)"
Diffstat (limited to 'arch/ia64/ia32/sys_ia32.c')
-rw-r--r--arch/ia64/ia32/sys_ia32.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index d430d36ae49..0afb4fe7c35 100644
--- 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: