Re: [PATCH] linux-user: fix incorrect msg_l[sr]pid members of target_msqid_ds
Helge Deller <[email protected]>
| Newsgroups | gmane.comp.emulators.qemu |
|---|---|
| Message-ID | <[email protected]> |
On 7/26/26 15:17, Helge Deller wrote:
> On 7/25/26 00:26, Pierrick Bouvier wrote:
>> On 7/24/2026 2:42 PM, Helge Deller wrote:
>>> On 7/24/26 18:48, Pierrick Bouvier wrote:
>>>> On 7/24/2026 9:01 AM, no92 via qemu development wrote:
>>>>> The members are declared as __kernel_pid_t in Linux UAPI headers.
>>>>> Analogous members in struct target_shmid_ds (shm_[cl]pid) are also
>>>>> declared as abi_int.
>>>>>
>>>>> Fixes: 1c54ff97bbde ("linux-user: fix and cleanup IPCOP_msg* ipc
>>>>> calls handling")
>>>>> Signed-off-by: no92 <[email protected]>
>>>>> ---
>>>>> linux-user/syscall.c | 12 ++++++------
>>>>> 1 file changed, 6 insertions(+), 6 deletions(-)
>>>>>
>>>>> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
>>>>> index 3da5530d42..616d543c7f 100644
>>>>> --- a/linux-user/syscall.c
>>>>> +++ b/linux-user/syscall.c
>>>>> @@ -4234,8 +4234,8 @@ struct target_msqid_ds
>>>>> abi_ulong __msg_cbytes;
>>>>> abi_ulong msg_qnum;
>>>>> abi_ulong msg_qbytes;
>>>>> - abi_ulong msg_lspid;
>>>>> - abi_ulong msg_lrpid;
>>>>> + abi_int msg_lspid;
>>>>> + abi_int msg_lrpid;
>>>> ...
>>>>
>>>> The change looks correct in itself.
>>>
>>> No.
>>> abi_ulong is wrong, but abi_int isn't much better either if you look at
>>> the kernel sources:
>>>
>>
>> I wrongly assumed the definition we had on bsd-user side was correct,
>> but didn't really think about checking it in linux sources, sorry.
I need to correct myself :-(
abi_int *is* much better than anything else.
Indirectly all current builds use glibc which switches to __msqid64_ds
instead of the old msqid_ds struct, and in there __pid_t is used, which
seems to be defined to int for all targets.
So, leo's patch is correct and I'll pull it into my linux-user next git tree as-is.
Thanks!
Helge