network/sockets: Add handshake01
PATCH 1/1 network/sockets: Add handshake01
From: Stephen Bertram <[email protected]>
Add a regression test for CVE-2026-74270 (81246a65303d "handshake:
Require admin permission for DONE command"). Verify that HANDSHAKE_CMD_DONE returns -EPERM for a sender without CAP_NET_ADMIN, while root reaches the handler and gets -EINVAL for the missing sockfd.
Register it as cve-2026-74270 in runtest/cve.
Reviewed and tested before submission: builds, passes check-handshake01, fails on the unfixed kernel and passes on the fixed kernel.
--- runtest/cve | 1 + testcases/network/sockets/.gitignore | 1 + testcases/network/sockets/handshake01.c | 243 ++++++++++++++++++++++++ 3 files changed, 245 insertions(+) create mode 100644 testcases/network/sockets/handshake01.c
runtest/cve +1 -0
@@ -105,3 +105,4 @@ cve-2026-46300 xfrm02 cve-2026-46300-skb-segment xfrm03 cve-2026-46331 cve-2026-46331 cve-2026-64564 sctphantom +cve-2026-74270 handshake01
testcases/network/sockets/.gitignore +1 -0
@@ -1,3 +1,4 @@ +/handshake01 /xfrm01 /xfrm02 /xfrm03
testcases/network/sockets/handshake01.c new file +243 -0
243 lines not on this page · raw message
Signature · 5 lines
2.56.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Stephen,
Quoted 22 lines · Stephen Bertram
network/sockets: Add handshake01
testcases/network/sockets/handshake01.c new file +20
-0+static int unprivileged_done (void ) +{ +int fds[2 ], err =0 ; +pid_t pid; + +SAFE_PIPE (fds); + pid =SAFE_FORK (); + +if (!pid) { +int ret; + +SAFE_CLOSE (fds[0 ]); + +SAFE_SETGROUPS (0 ,NULL ); +SAFE_SETGID (nobody_gid); +SAFE_SETUID (nobody_uid); + + ret =send_done (); + +SAFE_WRITE (SAFE_WRITE_ALL , fds[1 ], &ret,sizeof (ret));
testcases/network/sockets/handshake01.c line 203
Quoted 10 lines
testcases/network/sockets/handshake01.c new file +10
-0+_exit (0 ); + } + +SAFE_CLOSE (fds[1 ]); +SAFE_READ (SAFE_READ_ALL , fds[0 ], &err,sizeof (err)); +SAFE_CLOSE (fds[0 ]); +SAFE_WAITPID (pid,NULL ,0 ); + +return err; +}
Call tst_res() directly in the child process and terminate with exit(0) instead of _exit(0) rather than sending the result over a pipe to the parent. Drop SAFE_PIPE() and SAFE_WAITPID(), as the LTP library propagates child results via shared memory and reaps children automatically.
testcases/network/sockets/handshake01.c line 209
Quoted 5 lines
testcases/network/sockets/handshake01.c new file +5
-0+static void run (void ) +{ +int root_err, child_err; + + nl_family_id =resolve_family (HANDSHAKE_FAMILY_NAME );
Move nl_family_id = resolve_family(HANDSHAKE_FAMILY_NAME) to setup() so the static family ID resolution and TCONF check run once instead of on every -i iteration.
Verdict - Needs revision
---
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
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
PATCH v2 1/1 network/sockets: Add handshake01
In reply to Stephen Bertram via ltpFrom: Stephen Bertram <[email protected]>
Add a regression test for CVE-2026-74270 (81246a65303d "handshake:
Require admin permission for DONE command"). Verify that HANDSHAKE_CMD_DONE returns -EPERM for a sender without CAP_NET_ADMIN, while root reaches the handler and gets -EINVAL for the missing sockfd.
Register it as cve-2026-74270 in runtest/cve.
Reviewed and tested before submission: builds, passes check-handshake01, fails on the unfixed kernel and passes on the fixed kernel.
--- runtest/cve | 1 + testcases/network/sockets/.gitignore | 1 + testcases/network/sockets/handshake01.c | 230 ++++++++++++++++++++++++ 3 files changed, 232 insertions(+) create mode 100644 testcases/network/sockets/handshake01.c
runtest/cve +1 -0
@@ -105,3 +105,4 @@ cve-2026-46300 xfrm02 cve-2026-46300-skb-segment xfrm03 cve-2026-46331 cve-2026-46331 cve-2026-64564 sctphantom +cve-2026-74270 handshake01
testcases/network/sockets/.gitignore +1 -0
@@ -1,3 +1,4 @@ +/handshake01 /xfrm01 /xfrm02 /xfrm03
testcases/network/sockets/handshake01.c new file +230 -0
230 lines not on this page · raw message
Signature · 5 lines
2.56.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Stephen,
Quoted 1 line · Stephen Bertram
network/sockets: Add handshake01
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
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp