Skip to contentSkip to conversation

MIPS: Drop spurious __unused in struct compat_flock

PATCH New James Hogan 1 participant 1 message Feb 20, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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 8c6657cb50cb ("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).

---
Resend mainly so it lands in patchwork.

---
 arch/mips/include/asm/compat.h | 1 -
 1 file changed, 1 deletion(-)
arch/mips/include/asm/compat.h +0 -1
index 946681db8dc3..9a0fa66b81ac 100644
@@ -86,7 +86,6 @@ struct compat_flock {
 	compat_off_t	l_len;
 	s32		l_sysid;
 	compat_pid_t	l_pid;
-	short		__unused;
 	s32		pad[4];
 };
 
Signature · 1 line
2.13.6