Hi,
On 12/22/20 12:55 PM, Alejandro Colomar (mailing lists; readonly) wrote:
Hi Yang,
It looks good to me.
I'll add a few people that might want to comment.
The code returns a semid_ds structure, and if I take strace as reference implementation, then user space expects a semid_ds as well.
https://github.com/strace/strace/commit/8f0870a780bfd8cd9a91c3b7ad05baccda10bc84
In addition, the current page is self-inconsistent: seminfo doesn't contain sem_perm.
The pages for msgctl and shmctl are correct, i.e. no further obvious inconsistencies.
Thus: The man page for semctl is incorrect, the page needs to be updated.
Acked-by: manfred@xxxxxxxxxxxxxxxx
Thanks,
Alex
On 12/22/20 6:55 AM, Yang Xu wrote:
Since kernel commit a280d6dc77eb ("ipc/sem: introduce semctl(SEM_STAT_ANY)"),
it only skips read access check when using SEM_STAT_ANY command. And it should
use the semid_ds struct instead of seminfo struct. Fix this.
Signed-off-by: Yang Xu <xuyang2018.jy@xxxxxxxxxxxxxx>
---
man2/semctl.2 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/man2/semctl.2 b/man2/semctl.2
index dd3fb077b..a7462c5cc 100644
--- a/man2/semctl.2
+++ b/man2/semctl.2
@@ -297,8 +297,8 @@ all semaphore sets on the system.
.TP
.BR SEM_STAT_ANY " (Linux-specific, since Linux 4.17)"
Return a
-.I seminfo
-structure containing the same information as for
+.I semid_ds
+structure as for
.BR SEM_STAT .
However,
.I sem_perm.mode