Bug 2141685

Summary: glibc: Restore IPC_64 support in sysvipc *ctl functions [rhel-9.2.0]
Product: Red Hat Enterprise Linux 9 Reporter: Florian Weimer <fweimer>
Component: glibcAssignee: Arjun Shankar <ashankar>
Status: CLOSED ERRATA QA Contact: Sergey Kolosov <skolosov>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.2CC: aarnold, alexander.hass, ashankar, bfinger, codonell, csay, dj, fweimer, marcel.brandau, markobri, mnewsome, mpolacek, pfrankli, sipoyare, skolosov
Target Milestone: rcKeywords: Bugfix, Patch, Triaged, ZStream
Target Release: ---   
Hardware: ppc64le   
OS: Unspecified   
Whiteboard:
Fixed In Version: glibc-2.34-49.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2141989 2142111 2142112 (view as bug list) Environment:
Last Closed: 2023-05-09 08:16:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2141728    
Bug Blocks: 2141989, 2142111, 2142112    

Description Florian Weimer 2022-11-10 13:27:11 UTC
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>

Comment 9 errata-xmlrpc 2023-05-09 08:16:01 UTC
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