RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1912670 - semctl SEM_STAT_ANY fails to pass the buffer specified by the caller to the kernel
Summary: semctl SEM_STAT_ANY fails to pass the buffer specified by the caller to the k...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: glibc
Version: 8.4
Hardware: All
OS: Linux
low
low
Target Milestone: pre-dev-freeze
: 8.5
Assignee: Carlos O'Donell
QA Contact: Sergey Kolosov
Eva-Lotte Gebhardt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-05 06:06 UTC by Li Wang
Modified: 2023-07-18 14:30 UTC (History)
9 users (show)

Fixed In Version: glibc-2.28-153.el8
Doc Type: Bug Fix
Doc Text:
.The `semctl` system call wrapper in `glibc` now treats `SEM_STAT_ANY` like `SEM_STAT` Previously, the `semctl` system call wrapper in `glibc` did not treat the kernel argument `SEM_STAT_ANY` like `SEM_STAT`. As a result, `glibc` did not pass the address of the result object `struct semid_ds` to the kernel, so that the kernel failed to update it. With this update, `glibc` now treats `SEM_STAT_ANY` like `SEM_STAT`, and as a result, applications can obtain `struct semid_ds` data using `SEM_STAT_ANY`.
Clone Of:
Environment:
Last Closed: 2021-11-09 19:28:09 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2021:4358 0 None None None 2021-11-09 19:28:32 UTC
Sourceware 26637 0 P2 RESOLVED semctl SEM_STAT_ANY fails to pass the buffer specified by the caller to the kernel 2021-02-19 09:36:57 UTC

Internal Links: 1978412 2141989

Description Li Wang 2021-01-05 06:06:18 UTC
Description of problem:

LTP/semctl09 failed on RHEL-8.4.

semctl09.c:67: TINFO: Test SYS_semctl syscall
semctl09.c:132: TINFO: Test SEM_STAT_ANY with nobody user
semctl09.c:56: TCONF: syscall(394) __NR_semctl not supported
semctl09.c:187: TWARN: semctl(12, 0, 0,...) failed: EPERM (1)
tst_test.c:1263: TINFO: Timeout per run is 0h 05m 00s
semctl09.c:70: TINFO: Test libc semctl()
semctl09.c:132: TINFO: Test SEM_STAT_ANY with nobody user
semctl09.c:149: TFAIL: SEM_STAT_ANY doesn't pass the buffer specified by the caller to kernel
semctl09.c:132: TINFO: Test SEM_STAT_ANY with root user
semctl09.c:149: TFAIL: SEM_STAT_ANY doesn't pass the buffer specified by the caller to kernel

Version-Release number of selected component (if applicable):
glibc-2.28-127.el8.x86_64

Additional info:
https://sourceware.org/bugzilla/show_bug.cgi?id=26637

Comment 2 Li Wang 2021-01-05 06:20:37 UTC

commit 574500a108be1d2a6a0dc97a075c9e0a98371aba
Author: Dmitry V. Levin <ldv>
Date:   Tue Sep 29 14:10:20 2020 -0300

    sysvipc: Fix SEM_STAT_ANY kernel argument pass [BZ #26637]
    
    Handle SEM_STAT_ANY the same way as SEM_STAT so that the buffer argument
    of SEM_STAT_ANY is properly passed to the kernel and back.
    
    The regression testcase checks for Linux specifix SysV ipc message
    control extension.  For IPC_INFO/SEM_INFO it tries to match the values
    against the tunable /proc values and for SEM_STAT/SEM_STAT_ANY it
    check if the create message queue is within the global list returned
    by the kernel.
    
    Checked on x86_64-linux-gnu and on i686-linux-gnu (Linux v5.4 and on
    Linux v4.15).
    
    Co-authored-by: Adhemerval Zanella  <adhemerval.zanella>

Comment 10 Sergey Kolosov 2021-04-12 09:54:11 UTC
No regressions have been found.

Comment 11 Eva-Lotte Gebhardt 2021-06-14 08:53:22 UTC
Hi Carlos,

I am Eva, a tech writer for the devtools team. Nice to meet you! This is my first draft for this bugfix RN, and I'd be very happy if you could give some feedback on this. 
Thank you very much!


.The `semctl` system call wrapper in `glibc` now treats `SEM_STAT_ANY` like `SEM_STAT`

Previously, the `semctl` system call wrapper in `glibc` did not treat the kernel argument `SEM_STAT_ANY` like `SEM_STAT`. As a result, `glibc` did not properly pass the address of the result object `struct semid_ds` to the kernel so that the kernel failed to update it properly. With this update, `SEM_STAT_ANY` is now treated like `SEM_STAT` by glibc, and as a result, applications can obtain `struct semid_ds` data using `SEM_STAT_ANY`.

Comment 12 Carlos O'Donell 2021-07-08 14:53:40 UTC
(In reply to Eva-Lotte Gebhardt from comment #11)
> .The `semctl` system call wrapper in `glibc` now treats `SEM_STAT_ANY` like
> `SEM_STAT`
> 
> Previously, the `semctl` system call wrapper in `glibc` did not treat the
> kernel argument `SEM_STAT_ANY` like `SEM_STAT`. As a result, `glibc` did not
> properly pass the address of the result object `struct semid_ds` to the
> kernel so that the kernel failed to update it properly. With this update,
> `SEM_STAT_ANY` is now treated like `SEM_STAT` by glibc, and as a result,
> applications can obtain `struct semid_ds` data using `SEM_STAT_ANY`.

This looks good to me. Thanks for the review.

Comment 15 errata-xmlrpc 2021-11-09 19:28:09 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 (Moderate: glibc security, 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/RHSA-2021:4358


Note You need to log in before you can comment on or make changes to this bug.