Starting with commit glibc-2.31.9000-687-g3283f71113 aka glibc-2.32~83, both IPC_INFO and MSG_INFO commands of msgctl return garbage because their argument of type "struct msginfo" is converted using kmsqid64_to_msqid64. This bug was found by strace test suite.
(In reply to Dmitry V. Levin from comment #0) > Starting with commit glibc-2.31.9000-687-g3283f71113 aka glibc-2.32~83, > both IPC_INFO and MSG_INFO commands of msgctl return garbage because their > argument of type "struct msginfo" is converted using kmsqid64_to_msqid64. typo: it's msqid64_to_kmsqid64, not kmsqid64_to_msqid64.
The bug is both in __msgctl64 and __msgctl: in case of IPC_INFO and MSG_INFO, instead of the pointer specified by the user, a pointer to an internal buffer on the stack is passed to the kernel. As result, the buffer specified by the user remains unchanged after IPC_INFO and MSG_INFO commands.
Fixed on 2.33 (20a00dbefca5695cccaa44846a482db8ccdd85ab).