blob: 81401def78ea4ef8b5bc0775f8b079421c2e789c (
plain) (
blame)
1
2
3
4
5
6
7
|
The issue described pertains to how the `setsockopt` system call is handled when emulating 64-bit Linux platforms using QEMU. Specifically, there's an incorrect marshaling of the `struct ip_mreqn` structure, which leads to the `imr_ifindex` field being improperly processed. This results in a failure when joining IP multicast groups under emulation due to the kernel interpreting the structure incorrectly.
The problem arises because the definition of `struct target_ip_mreqn` in QEMU's `linux-user/syscall_defs.h` uses an `abi_long` for `imr_ifindex`, whereas on Linux, this field is a 32-bit integer. This mismatch causes the size and alignment of the structure to differ from what the host kernel expects, leading to unexpected behavior or errors.
Additionally, there's concern about how QEMU handles the size validation of the `ip_mreq`/`ip_mreqn` structures. The current check allows sizes between those of `target_ip_mreq` (8 bytes) and `target_ip_mreqn` (16 bytes), which might lead to passing uninitialized memory or incorrect structure interpretations, further contributing to the issue.
**Category: syscall**
|