]> 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)
commitee9fe4dbd483332bccdf3620e8844512dba00189
tree1e72d01e5596dc00328c161253b242a6fb7b3317
parentf1e8a6eb354550cf017fffe583ea4c5400bf800e
net: compat: Ignore MSG_CMSG_COMPAT in compat_sys_{send, recv}msg

With commit 5d3468dcb4cd (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 (81ee38cd90af, 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 5d3468dcb4cd.

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

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: 5d3468dcb4cd (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