In order to call SHM_STAT_ANY kernel operations through shmctl on older glibc, it was necessary to pass SHM_STAT_ANY | IPC_64 in the command argument, otherwise the ipc system call would be invoked without the IPC_64 flag, giving unexpected results on powerpc64le-linux-gnu at least.
Current glibc no longer supports that because it checks the command argument for validity without masking the IPC_64 bit.
Fixed upstream with this commit:
commit 22a46dee24351fd5f4f188ad80554cad79c82524
Author: Florian Weimer <fweimer>
Date: Tue Nov 8 14:15:02 2022 +0100
Linux: Support __IPC_64 in sysvctl *ctl command arguments (bug 29771)
Old applications pass __IPC_64 as part of the command argument because
old glibc did not check for unknown commands, and passed through the
arguments directly to the kernel, without adding __IPC_64.
Applications need to continue doing that for old glibc compatibility,
so this commit enables this approach in current glibc.
For msgctl and shmctl, if no translation is required, make
direct system calls, as we did before the time64 changes. If
translation is required, mask __IPC_64 from the command argument.
For semctl, the union-in-vararg argument handling means that
translation is needed on all architectures.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella>
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (glibc bug fix and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2023:2481