]> git.baikalelectronics.ru Git - kernel.git/commit
net: compat: Ignore MSG_CMSG_COMPAT in compat_sys_{send, recv}msg
authorCatalin Marinas <catalin.marinas@arm.com>
Mon, 23 Feb 2015 18:12:56 +0000 (18:12 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 23 Feb 2015 22:22:05 +0000 (17:22 -0500)
commit1453b8f084d7a76659611b30e06e3f3877ad3032
tree1e72d01e5596dc00328c161253b242a6fb7b3317
parent3acc3d0803bdb4df99f13ccb36d72c77c2698838
net: compat: Ignore MSG_CMSG_COMPAT in compat_sys_{send, recv}msg

With commit 34b0e98c7f82 (net: Unbreak compat_sys_{send,recv}msg), the
MSG_CMSG_COMPAT flag is blocked at the compat syscall entry points,
changing the kernel compat behaviour from the one before the commit it
was trying to fix (a0dd3ab1ed13, net: Block MSG_CMSG_COMPAT in
send(m)msg and recv(m)msg).

On 32-bit kernels (!CONFIG_COMPAT), MSG_CMSG_COMPAT is 0 and the native
32-bit sys_sendmsg() allows flag 0x80000000 to be set (it is ignored by
the kernel). However, on a 64-bit kernel, the compat ABI is different
with commit 34b0e98c7f82.

This patch changes the compat_sys_{send,recv}msg behaviour to the one
prior to commit a0dd3ab1ed13.

The problem was found running 32-bit LTP (sendmsg01) binary on an arm64
kernel. Arguably, LTP should not pass 0xffffffff as flags to sendmsg()
but the general rule is not to break user ABI (even when the user
behaviour is not entirely sane).

Fixes: 34b0e98c7f82 (net: Unbreak compat_sys_{send,recv}msg)
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/compat.c