linux-user: always translate cmsg when recvmsg
commit16c81dd563b94e9392a578ccf5aa762d01e8f165
authorIcenowy Zheng <uwu@icenowy.me>
Fri, 28 Oct 2022 08:12:20 +0000 (28 16:12 +0800)
committerLaurent Vivier <laurent@vivier.eu>
Wed, 2 Nov 2022 16:29:17 +0000 (2 17:29 +0100)
tree47691648eb5f4ee0a7e8e359f830f296c1b79d91
parent8b95210fcb2330dd3b682ff3a5a734881baa8bef
linux-user: always translate cmsg when recvmsg

It's possible that a message contains both normal payload and ancillary
data in the same message, and even if no ancillary data is available
this information should be passed to the target, otherwise the target
cmsghdr will be left uninitialized and the target is going to access
uninitialized memory if it expects cmsg.

Always call the function that translate cmsg when recvmsg, because that
function should be empty-cmsg-safe (it creates an empty cmsg in the
target).

Signed-off-by: Icenowy Zheng <uwu@icenowy.me>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20221028081220.1604244-1-uwu@icenowy.me>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/syscall.c