Skip to content
Browse files

fs/compat: fix lookup_dcookie() parameter handling

Commit d5dc77b ("consolidate compat lookup_dcookie()") coverted all
architectures to the new compat_sys_lookup_dcookie() syscall.

The "len" paramater of the new compat syscall must have the type
compat_size_t in order to enforce zero extension for architectures where
the ABI requires that the caller of a function performed zero and/or
sign extension to 64 bit of all parameters.

Signed-off-by: Heiko Carstens <>
Cc: Al Viro <>
Cc: Ingo Molnar <>
Cc: "H. Peter Anvin" <>
Cc: Hendrik Brueckner <>
Cc: Martin Schwidefsky <>
Cc: <>	[v3.10+]
Signed-off-by: Andrew Morton <>
Signed-off-by: Linus Torvalds <>
  • Loading branch information...
1 parent dfd948e commit d8d14bd09cddbaf0168d61af638455a26bd027ff Heiko Carstens committed with Jan 29, 2014
Showing with 2 additions and 2 deletions.
  1. +1 −1 fs/dcookies.c
  2. +1 −1 include/linux/compat.h
2 fs/dcookies.c
@@ -204,7 +204,7 @@ SYSCALL_DEFINE3(lookup_dcookie, u64, cookie64, char __user *, buf, size_t, len)
-COMPAT_SYSCALL_DEFINE4(lookup_dcookie, u32, w0, u32, w1, char __user *, buf, size_t, len)
+COMPAT_SYSCALL_DEFINE4(lookup_dcookie, u32, w0, u32, w1, char __user *, buf, compat_size_t, len)
#ifdef __BIG_ENDIAN
return sys_lookup_dcookie(((u64)w0 << 32) | w1, buf, len);
2 include/linux/compat.h
@@ -422,7 +422,7 @@ extern long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
compat_long_t addr, compat_long_t data);
-asmlinkage long compat_sys_lookup_dcookie(u32, u32, char __user *, size_t);
+asmlinkage long compat_sys_lookup_dcookie(u32, u32, char __user *, compat_size_t);
* epoll (fs/eventpoll.c) compat bits follow ...

0 comments on commit d8d14bd

Please sign in to comment.
Something went wrong with that request. Please try again.