Potential issues for linux socket syscall

Weike.Chen at Dell.com Weike.Chen at Dell.com
Thu Feb 21 02:59:00 UTC 2019


Hi Linux emulation experts,

I find a potential issue on FreeBSD 12 official release for Linux emulation syscall.

The function 'linux_getsockname' in 'linux_socket.c' calls 'bsd_to_linux_sockaddr', and it calls 'bsd_to_linux_domain' to convert 'sa_family' from BSD domain to Linux domain.

But after calling  'bsd_to_linux_sockaddr', 'linux_sa_put' is called, and it calls 'bsd_to_linux_domain' to convert 'sa_family' from BSD domain to Linux domain again.
But the 'sa_family' has already been converted.
Since the value of AF_INTE6 and LINUX_AF_INET6 is different, and converting twice will cause issue. 




Regards,
Alvin Chen
Dell | Cloud Client Computing
office +86-10-82862506, fax +86-10-82861554, Dell Lync 8672506
weike_chen at dell.com



More information about the freebsd-emulation mailing list