Bug 278949 - sysv IPC sysctl's behave differently for 32-bit on 64bits hosts
Summary: sysv IPC sysctl's behave differently for 32-bit on 64bits hosts
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 15.0-CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-13 10:41 UTC by Ricardo Branco
Modified: 2024-05-23 00:28 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ricardo Branco 2024-05-13 10:41:03 UTC
To reproduce:

I created only one object of each type with the ipcmk command shipped by util-linux like this:
$ ipcmk -M 1k -S 1 -Q

Then ran ipcs in Ubuntu Jammy 64-bits & 32-bits created with `debootstrap [--arch i386] /compat/ubuntu[32]`

$ sudo chroot /compat/ubuntu ipcs -a

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages    
0x0fb549ed 65536      1000       644        0            0           

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
0x25caab18 65536      1000       644        4096       0                       

------ Semaphore Arrays --------
key        semid      owner      perms      nsems     
0xbf526696 65536      1000       644        1         

$ sudo chroot /compat/ubuntu32 ipcs -a

------ Message Queues --------
key        msqid      owner      perms      used-bytes   messages    
0xdeadc0de 2147483647 3735929054 336        16045693110842147038 16045693110842147038
0xdeadc0de 2147483647 3735929054 336        16045693110842147038 16045693110842147038
0xdeadc0de 2147483647 3735929054 336        16045693110842147038 16045693110842147038
0xdeadc0de 2147483647 3735929054 336        16045693110842147038 16045693110842147038
0xdeadc0de 2147483647 3735929054 336        16045693110842147038 16045693110842147038
0xdeadc0de 2147483647 3735929054 336        16045693110842147038 16045693110842147038
0xdeadc0de 2147483647 3735929054 336        16045693110842147038 16045693110842147038
0xdeadc0de 2147483647 3735929054 336        16045693110842147038 16045693110842147038
0xdeadc0de 2147483647 3735929054 336        16045693110842147038 16045693110842147038
0xdeadc0de 2147483647 3735929054 336        16045693110842147038 16045693110842147038
0xdeadc0de 2147483647 3735929054 336        16045693110842147038 16045693110842147038
0xdeadc0de 2147483647 3735929054 336        16045693110842147038 16045693110842147038
0xdeadc0de 2147483647 3735929054 336        16045693110842147038 16045693110842147038
0xdeadc0de 2147483647 3735929054 336        16045693110842147038 16045693110842147038
0xdeadc0de 2147483647 3735929054 336        16045693110842147038 16045693110842147038
0xdeadc0de 2147483647 3735929054 336        16045693110842147038 16045693110842147038

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status      
0x00001000 65536      1000       644        71807      1715595399              

------ Semaphore Arrays --------
key        semid      owner      perms      nsems     
0x00000000 65536      1000       644        0
Comment 1 Konstantin Belousov freebsd_committer freebsd_triage 2024-05-13 11:56:25 UTC
https://reviews.freebsd.org/D45175
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-05-16 17:54:10 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=87a156527563d0728bff355093e26943da3d7fad

commit 87a156527563d0728bff355093e26943da3d7fad
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-05-13 17:17:47 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-05-16 17:53:31 +0000

    SysV IPC: provide in-kernel helpers to obtain ipcs(8)-like information

    PR:     278949
    Reviewed by:    markj
    Tested by:      Ricardo Branco <rbranco@suse.de>
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D45175

 sys/kern/sysv_msg.c | 34 ++++++++++++++++++++++++++++++++++
 sys/kern/sysv_sem.c | 33 +++++++++++++++++++++++++++++++++
 sys/kern/sysv_shm.c | 36 ++++++++++++++++++++++++++++++++++++
 sys/sys/msg.h       |  3 +++
 sys/sys/sem.h       |  3 +++
 sys/sys/shm.h       |  2 ++
 6 files changed, 111 insertions(+)
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-05-23 00:27:56 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=b76674a73988eb708bdb53e11c5c54e8488b33a1

commit b76674a73988eb708bdb53e11c5c54e8488b33a1
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-05-13 17:17:47 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-05-23 00:26:44 +0000

    SysV IPC: provide in-kernel helpers to obtain ipcs(8)-like information

    PR:     278949

    (cherry picked from commit 87a156527563d0728bff355093e26943da3d7fad)

 sys/kern/sysv_msg.c | 34 ++++++++++++++++++++++++++++++++++
 sys/kern/sysv_sem.c | 33 +++++++++++++++++++++++++++++++++
 sys/kern/sysv_shm.c | 36 ++++++++++++++++++++++++++++++++++++
 sys/sys/msg.h       |  3 +++
 sys/sys/sem.h       |  3 +++
 sys/sys/shm.h       |  2 ++
 6 files changed, 111 insertions(+)
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-05-23 00:28:59 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=07b7dec1fe4296cdf470013087180a80a0d4a2cf

commit 07b7dec1fe4296cdf470013087180a80a0d4a2cf
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-05-13 17:17:47 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-05-22 23:47:23 +0000

    SysV IPC: provide in-kernel helpers to obtain ipcs(8)-like information

    PR:     278949

    (cherry picked from commit 87a156527563d0728bff355093e26943da3d7fad)

 sys/kern/sysv_msg.c | 34 ++++++++++++++++++++++++++++++++++
 sys/kern/sysv_sem.c | 33 +++++++++++++++++++++++++++++++++
 sys/kern/sysv_shm.c | 36 ++++++++++++++++++++++++++++++++++++
 sys/sys/msg.h       |  3 +++
 sys/sys/sem.h       |  3 +++
 sys/sys/shm.h       |  2 ++
 6 files changed, 111 insertions(+)