Re: [PATCH] ipc: provide generic compat versions of IPC syscalls

From: Arnd Bergmann
Date: Fri Dec 09 2011 - 11:02:47 EST


On Friday 09 December 2011, Chris Metcalf wrote:
>
> Several of the existing compat IPC syscalls are really just i386
> compatibility, not generic compatibility. semctl() expects a
> pointer to the fourth argument, instead of the fourth argument itself.
> msgsnd(), msgrcv() and shmat() expect arguments in different order.
>
> This change adds an __ARCH_WANT_GENERIC_COMPAT_IPC define that
> can be set in <asm/compat.h> to indicate that the IPC compat code
> should provide exactly the same APIs to "compat" users as the
> regular IPC code does to regular users. In addition, it sets up
> to always request the IPC_64 mode, since that's what the <asm-generic>
> APIs always use.
>
> The workaround code in "tile" for msgsnd() and msgrcv() is removed
> with this change; it fixes the bug that shmat() and semctl() were
> not also being properly converted to expect generic compat IPC.
>
> Signed-off-by: Chris Metcalf <cmetcalf@xxxxxxxxxx>

I like the patch, but I think the __ARCH_WANT_GENERIC_COMPAT_IPC
should be defined as the opposite, so all "old" architectures
have to set it while tile (and future architectures like arm64
and unicore64) just get the default.

> Finding the shmat/semctl bugs in tilegx finally motivated me to go and
> do the thing he suggested 18 months ago. :-) Whether someone wants to
> go a step further and actually move the i386-ish versions into arch/x86
> I will leave to the x86 platform maintainers; I also don't know whether,
> perhaps, some other platforms are actually using the i386 convention.

I don't see them as x86 specific. We have powerpc, mips, s390, sparc and
x86 using the legacy method, while only parisc and tile get it right
and use the syscalls directly.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/