* [LTP] [PATCH 0/2] openposix: mq_close/2-1: Fix failure on v7.3+
@ 2026-10-18 16:01 Avinesh Kumar via ltp
2026-10-18 16:01 ` [LTP] [PATCH 1/2] openposix: mq_close/2-1: Use a valid signal number for mq_notify() Avinesh Kumar via ltp
2026-10-18 16:01 ` [LTP] [PATCH 2/2] openposix: mq_close/2-1: Initialize sigev_signo and check for EBUSY Avinesh Kumar via ltp
0 siblings, 2 replies; 6+ messages in thread
From: Avinesh Kumar via ltp @ 2026-10-18 16:01 UTC (permalink / raw)
To: ltp
Linux commit 1184f5e82009 ("mqueue: reject mq_notify with signo 0"),
merged in v7.3-rc1, makes mq_notify() with SIGEV_SIGNAL fail with EINVAL
if sigev_signo is 0. mq_close/2-1 passes signo 0 in the child's last
mq_notify() call, so it fails on v7.3+.
Patch 1 fixes that failure by using a valid signal number.
Patch 2 fixes the same problem for the child's first mq_notify() call.
It never sets sigev_signo, so it is rejected with EINVAL instead of
failing with EBUSY as intended. The test only checked that the call
failed, so it kept passing. The patch sets sigev_signo and requires
EBUSY.
Avinesh Kumar (2):
openposix: mq_close/2-1: Use a valid signal number for mq_notify()
openposix: mq_close/2-1: Initialize sigev_signo and check for EBUSY
.../conformance/interfaces/mq_close/2-1.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
--
2.56.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* [LTP] [PATCH 1/2] openposix: mq_close/2-1: Use a valid signal number for mq_notify()
2026-10-18 16:01 [LTP] [PATCH 0/2] openposix: mq_close/2-1: Fix failure on v7.3+ Avinesh Kumar via ltp
@ 2026-10-18 16:01 ` Avinesh Kumar via ltp
2026-10-18 17:54 ` [LTP] " linuxtestproject.agent
2026-10-20 10:10 ` [LTP] [PATCH 1/2] " Cyril Hrubis
2026-10-18 16:01 ` [LTP] [PATCH 2/2] openposix: mq_close/2-1: Initialize sigev_signo and check for EBUSY Avinesh Kumar via ltp
1 sibling, 2 replies; 6+ messages in thread
From: Avinesh Kumar via ltp @ 2026-10-18 16:01 UTC (permalink / raw)
To: ltp
From: Avinesh Kumar <avinesh.kumar@suse.com>
Linux commit 1184f5e82009 ("mqueue: reject mq_notify with signo 0")
in v7.3-rc1, makes mq_notify() with SIGEV_SIGNAL fail with EINVAL
if sigev_signo is 0.
In mq_close/2-1 test, the child registers its notification with signo 0
after the parent's mq_close(), so the call is now rejected before the
queue state is checked and the test fails on v7.3+.
Use SIGUSR1 as a valid signal.
Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com>
---
.../open_posix_testsuite/conformance/interfaces/mq_close/2-1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_close/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_close/2-1.c
index 6e704158a575..971278aee730 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mq_close/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mq_close/2-1.c
@@ -193,7 +193,7 @@ static int child_process(char *qname, int read_pipe, int write_pipe)
}
// try notify after parent closed queue - should succeed
se.sigev_notify = SIGEV_SIGNAL;
- se.sigev_signo = 0;
+ se.sigev_signo = SIGUSR1;
rval = mq_notify(queue, &se);
// send 'd' for success and 'e' for failure
--
2.56.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [LTP] [PATCH 2/2] openposix: mq_close/2-1: Initialize sigev_signo and check for EBUSY
2026-10-18 16:01 [LTP] [PATCH 0/2] openposix: mq_close/2-1: Fix failure on v7.3+ Avinesh Kumar via ltp
2026-10-18 16:01 ` [LTP] [PATCH 1/2] openposix: mq_close/2-1: Use a valid signal number for mq_notify() Avinesh Kumar via ltp
@ 2026-10-18 16:01 ` Avinesh Kumar via ltp
2026-10-20 10:22 ` Cyril Hrubis
1 sibling, 1 reply; 6+ messages in thread
From: Avinesh Kumar via ltp @ 2026-10-18 16:01 UTC (permalink / raw)
To: ltp
From: Avinesh Kumar <avinesh.kumar@suse.com>
The first mq_notify() call in the child is expected to fail with EBUSY,
because the parent still has a notification registered on the queue.
But sigev_signo is never set for this call, so the kernel gets whatever
is left on the stack. That is often 0, depending on compiler flags
and stack layout.
This used to be harmless, since do_mq_notify() accepted signo 0 and the
call reached the EBUSY check. Since Linux commit 1184f5e82009 ("mqueue:
reject mq_notify with signo 0"), merged in v7.3-rc1, it fails with
EINVAL before the queue state is checked. The test only checks that the
call failed, not why, so it still passes without exercising the EBUSY
case. Trace on v7.3+ with the previous patch (which fixed the child's
second mq_notify() call) applied:
# strace -f -e trace=mq_notify ./mq_close_2-1.run-test
strace: Process 32289 attached
[pid 32288] mq_notify(4, {sigev_signo=SIGUSR1, sigev_notify=SIGEV_SIGNAL}) = 0
[pid 32289] mq_notify(3, {sigev_signo=0, sigev_notify=SIGEV_SIGNAL}) = -1 EINVAL (Invalid argument)
[pid 32289] mq_notify(3, {sigev_signo=SIGUSR1, sigev_notify=SIGEV_SIGNAL}) = 0
Test PASSED
[pid 32289] +++ exited with 0 +++
Set sigev_signo to SIGUSR1 and verify the call fails with EBUSY, so an
unexpected errno is reported as failure instead of passing silently:
# strace -f -e trace=mq_notify ./mq_close_2-1.run-test
strace: Process 32535 attached
[pid 32534] mq_notify(4, {sigev_signo=SIGUSR1, sigev_notify=SIGEV_SIGNAL}) = 0
[pid 32535] mq_notify(3, {sigev_signo=SIGUSR1, sigev_notify=SIGEV_SIGNAL}) = -1 EBUSY (Device or resource busy)
[pid 32535] mq_notify(3, {sigev_signo=SIGUSR1, sigev_notify=SIGEV_SIGNAL}) = 0
Test PASSED
[pid 32535] +++ exited with 0 +++
Signed-off-by: Avinesh Kumar <avinesh.kumar@suse.com>
---
.../conformance/interfaces/mq_close/2-1.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/mq_close/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/mq_close/2-1.c
index 971278aee730..48f80a1ee430 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/mq_close/2-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/mq_close/2-1.c
@@ -175,12 +175,18 @@ static int child_process(char *qname, int read_pipe, int write_pipe)
if (queue == (mqd_t) - 1) {
return PTS_UNRESOLVED;
}
- // try notify while parent still has queue open - should fail
+ // try notify while parent still has queue open - should fail with EBUSY
se.sigev_notify = SIGEV_SIGNAL;
+ se.sigev_signo = SIGUSR1;
if (!mq_notify(queue, &se)) {
puts(ERROR_PREFIX "mq_notify (2): " "should have failed");
return PTS_UNRESOLVED;
}
+ if (errno != EBUSY) {
+ perror(ERROR_PREFIX "mq_notify (2): expected EBUSY");
+ return PTS_UNRESOLVED;
+ }
+
// send 'b' - signal parent to close queue
rval = send_receive(read_pipe, write_pipe, 'b', &reply);
if (rval) {
--
2.56.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [LTP] openposix: mq_close/2-1: Use a valid signal number for mq_notify()
2026-10-18 16:01 ` [LTP] [PATCH 1/2] openposix: mq_close/2-1: Use a valid signal number for mq_notify() Avinesh Kumar via ltp
@ 2026-10-18 17:54 ` linuxtestproject.agent
2026-10-20 10:10 ` [LTP] [PATCH 1/2] " Cyril Hrubis
1 sibling, 0 replies; 6+ messages in thread
From: linuxtestproject.agent @ 2026-10-18 17:54 UTC (permalink / raw)
To: Avinesh Kumar; +Cc: ltp
Hi Avinesh,
On 18 Oct 2026, Avinesh Kumar wrote:
> openposix: mq_close/2-1: Use a valid signal number for mq_notify()
> openposix: mq_close/2-1: Initialize sigev_signo and check for EBUSY
Verdict - Reviewed
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH 1/2] openposix: mq_close/2-1: Use a valid signal number for mq_notify()
2026-10-18 16:01 ` [LTP] [PATCH 1/2] openposix: mq_close/2-1: Use a valid signal number for mq_notify() Avinesh Kumar via ltp
2026-10-18 17:54 ` [LTP] " linuxtestproject.agent
@ 2026-10-20 10:10 ` Cyril Hrubis
1 sibling, 0 replies; 6+ messages in thread
From: Cyril Hrubis @ 2026-10-20 10:10 UTC (permalink / raw)
To: Avinesh Kumar; +Cc: ltp
Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [LTP] [PATCH 2/2] openposix: mq_close/2-1: Initialize sigev_signo and check for EBUSY
2026-10-18 16:01 ` [LTP] [PATCH 2/2] openposix: mq_close/2-1: Initialize sigev_signo and check for EBUSY Avinesh Kumar via ltp
@ 2026-10-20 10:22 ` Cyril Hrubis
0 siblings, 0 replies; 6+ messages in thread
From: Cyril Hrubis @ 2026-10-20 10:22 UTC (permalink / raw)
To: Avinesh Kumar; +Cc: ltp
Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-10-20 10:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-18 16:01 [LTP] [PATCH 0/2] openposix: mq_close/2-1: Fix failure on v7.3+ Avinesh Kumar via ltp
2026-10-18 16:01 ` [LTP] [PATCH 1/2] openposix: mq_close/2-1: Use a valid signal number for mq_notify() Avinesh Kumar via ltp
2026-10-18 17:54 ` [LTP] " linuxtestproject.agent
2026-10-20 10:10 ` [LTP] [PATCH 1/2] " Cyril Hrubis
2026-10-18 16:01 ` [LTP] [PATCH 2/2] openposix: mq_close/2-1: Initialize sigev_signo and check for EBUSY Avinesh Kumar via ltp
2026-10-20 10:22 ` Cyril Hrubis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.