Skip to content

Commit 6ae1756

Browse files
committed
MIPS: Drop spurious __unused in struct compat_flock
MIPS' struct compat_flock doesn't match the 32-bit struct flock, as it has an extra short __unused before pad[4], which combined with alignment increases the size to 40 bytes compared with struct flock's 36 bytes. Since commit 8c6657c ("Switch flock copyin/copyout primitives to copy_{from,to}_user()"), put_compat_flock() writes the full compat_flock struct to userland, which results in corruption of the userland word after the struct flock when running 32-bit userlands on 64-bit kernels. This was observed to cause a bus error exception when starting Firefox on Debian 8 (Jessie). Reported-by: Peter Mamonov <[email protected]> Signed-off-by: James Hogan <[email protected]> Tested-by: Peter Mamonov <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: Al Viro <[email protected]> Cc: [email protected] Cc: <[email protected]> # 4.13+ Patchwork: https://patchwork.linux-mips.org/patch/18646/
1 parent 91ab883 commit 6ae1756

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

arch/mips/include/asm/compat.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ struct compat_flock {
8686
compat_off_t l_len;
8787
s32 l_sysid;
8888
compat_pid_t l_pid;
89-
short __unused;
9089
s32 pad[4];
9190
};
9291

0 commit comments

Comments
 (0)