Failure to translate host to target errno in IP_RECVERR, IPV6_RECVERR emulation
Host environment
Random Cirrus CI QEMU (x86_64), but the bug is obvious in current master.
Emulated/Virtualized environment
Linux MIPS64 and MIPS64 EL.
Description of problem
In translated IP_RECVERR (and IPV6_RECVERR) control messages, the ee_errno
is not translated, so host errnos are observed on guests. E.g., ECONNREFUSED
is 111 on x86_64 host, but expected to be 146 in MIPS ABI.
Steps to reproduce
Additional information
The bugs are on lines 1970 and 2014 here.
The fix is something like:
__put_user(host_to_target_errno(errh->ee.ee_errno), &target_errh->ee.ee_errno);