[strace/strace] sysvipc handling is time64-incompatible (#116)

arndb notifications at github.com
Tue Jan 14 10:55:10 UTC 2020


On Tue, Jan 14, 2020 at 10:59 AM Dmitry V. Levin <notifications at github.com>
wrote:

> On Tue, Jan 14, 2020 at 01:27:09AM -0800, arndb wrote:
> > Can you be more specific about what the problem is with the uapi
> headers? I looked at them again now but fail to see what's wrong with them.
>
> x32: I cannot reproduce it any longer where I used to, maybe something has
> been fixed in uapi for x32.
>

Ok, this is know to have been broken in uapi headers between v4.3 and v4.17.

See commits f4b4aae18288 ("x86/headers/uapi: Fix __BITS_PER_LONG value
for x32 builds") and 1a512c0882bd ("x86/ipc: Fix x32 version of shmid64_ds
and
msqid64_ds").


> sparc:
> according to struct compat_ipc64_perm defined in
> arch/sparc/include/asm/compat.h,
> the type of uid is __compat_uid32_t aka u32,
> but, according to struct ipc64_perm defined in
> arch/sparc/include/uapi/asm/ipcbuf.h,
> the type of uid is __kernel_uid_t which is defined to unsigned short on
> sparc.
>
> I suppose the regression was introduced by commit
> 83c86984bff2d793c91eb710af7857828b9ddb49 aka v2.6.29-rc1~501^2~6
>
> If my guess is correct, then the only working form of IPC_STAT on sparc32
> since that commit is sparc64 in compat mode.


Ok, so this would be a bug with what sysvipc on sparc32 does in the kernel,
rather than a bug of the uapi headers not describing what it does, correct?

Adding the SPARC list and maintainer to Cc. Yes, I read it the same way.
In particular, Sam back then wrote

commit 83c86984bff2d793c91eb710af7857828b9ddb49
Author: Sam Ravnborg <sam at ravnborg.org>
Date:   Sun Jan 4 15:44:22 2009 -0800

    sparc: unify ipcbuf.h

    The ony difference is the size of the mode.
    sparc has extra padding to compensate for this.

    Signed-off-by: Sam Ravnborg <sam at ravnborg.org>
    Signed-off-by: David S. Miller <davem at davemloft.net>

However, aside from mode, the other fields that were changed are
'uid', 'gid', 'cuid' and 'cgid'. It's been 11 years since that ABI change,
so I wonder if anyone has started relying on the changed behavior
in the meantime, or sparc32 users just don't use sysvipc.

I checked glibc and uclibc-ng, and both use the pre-2009 version
of the ABI. I also checked the leon-linux patches from
https://www.gaisler.com/anonftp/linux/linux-2.6/kernel/ to see
if they had already come across this, but there is no fix either.

       Arnd


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/strace/strace/issues/116#issuecomment-574118320
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20200114/10b58fdb/attachment.html>


More information about the Strace-devel mailing list