d/p/lp1910312: Backport upstream fix for SEM_STAT_ANY (LP: #1910312)
The fix landed in 2.33 and was tracked in upstream as part of
https://sourceware.org/bugzilla/show_bug.cgi?id=26637. The backport was
straight forward as the only conflict was due to:
commit dba950e3174a5210b900a26a7d2f361cadea2834
sysv: linux: Add 64-bit time_t variant for semctl
The cherry picked/backported commit includes code fix up, test-case and
build fixup for the related test-case.
It was tested with the LTP test suite.
Without the patch applied:
tst_test.c:1526: TINFO: Timeout per run is 0h 00m 30s
semctl09.c:76: TINFO: Test SYS_semctl syscall
semctl09.c:141: TINFO: Test SEM_STAT_ANY with nobody user
semctl09.c:163: TPASS: SEM_INFO returned valid index 10 to semid 10
semctl09.c:173: TPASS: Counted used = 1
semctl09.c:121: TPASS: semset_cnt = 1
semctl09.c:128: TPASS: sen_cnt = 2
semctl09.c:141: TINFO: Test SEM_STAT_ANY with root user
semctl09.c:163: TPASS: SEM_INFO returned valid index 10 to semid 10
semctl09.c:173: TPASS: Counted used = 1
semctl09.c:121: TPASS: semset_cnt = 1
semctl09.c:128: TPASS: sen_cnt = 2
semctl09.c:79: TINFO: Test libc semctl()
semctl09.c:200: TFAIL: SEM_STAT_ANY doesn't pass the buffer specified by
the caller to kernel
HINT: You _MAY_ be missing glibc fixes:
https://sourceware.org/git/?p=glibc.git;a=commit;h=574500a108be
Summary:
passed 8
failed 1
broken 0
skipped 0
warnings 0
With the patch applied:
tst_test.c:1526: TINFO: Timeout per run is 0h 00m 30s
semctl09.c:76: TINFO: Test SYS_semctl syscall
semctl09.c:141: TINFO: Test SEM_STAT_ANY with nobody user
semctl09.c:163: TPASS: SEM_INFO returned valid index 8 to semid 8
semctl09.c:173: TPASS: Counted used = 1
semctl09.c:121: TPASS: semset_cnt = 1
semctl09.c:128: TPASS: sen_cnt = 2
semctl09.c:141: TINFO: Test SEM_STAT_ANY with root user
semctl09.c:163: TPASS: SEM_INFO returned valid index 8 to semid 8
semctl09.c:173: TPASS: Counted used = 1
semctl09.c:121: TPASS: semset_cnt = 1
semctl09.c:128: TPASS: sen_cnt = 2
semctl09.c:79: TINFO: Test libc semctl()
semctl09.c:141: TINFO: Test SEM_STAT_ANY with nobody user
semctl09.c:163: TPASS: SEM_INFO returned valid index 9 to semid 9
semctl09.c:173: TPASS: Counted used = 1
semctl09.c:121: TPASS: semset_cnt = 1
semctl09.c:128: TPASS: sen_cnt = 2
semctl09.c:141: TINFO: Test SEM_STAT_ANY with root user
semctl09.c:163: TPASS: SEM_INFO returned valid index 9 to semid 9
semctl09.c:173: TPASS: Counted used = 1
semctl09.c:121: TPASS: semset_cnt = 1
semctl09.c:128: TPASS: sen_cnt = 2
Summary:
passed 16
failed 0
broken 0
skipped 0
warnings 0
Signed-off-by: Andrei Gherzan <email address hidden>