selftests: af_unix: test zero-length MSG_PEEK with OOB data
Subsystems (4)
RFC 1/1 selftests: af_unix: test zero-length MSG_PEEK with OOB data
A zero-length MSG_PEEK on an AF_UNIX stream socket can busy-loop when an OOB skb is queued. Add a regression test that sends MSG_OOB and checks that recv(..., 0, MSG_PEEK) returns promptly in a child process. Skip the test when AF_UNIX OOB support is unavailable.
Register the test as a normal generated program so it is included in the AF_UNIX selftest run.
The regression was fixed by commit 6e5ee08eb585 ("af_unix: Return immediately when manage_oob() returns NULL for 0-length buffer.").
Tested: fails on 7.0.0-34-generic (expected regression); passes in QEMU with a kernel built from 0c2669a9f4a1.
--- .../testing/selftests/net/af_unix/.gitignore | 1 + tools/testing/selftests/net/af_unix/Makefile | 1 + .../net/af_unix/unix_oob_zero_peek.c | 89 +++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 tools/testing/selftests/net/af_unix/unix_oob_zero_peek.c
tools/testing/selftests/net/af_unix/.gitignore +1 -0
@@ -9,3 +9,4 @@ so_peek_off unix_connect unix_connreset unix_listen +unix_oob_zero_peek
tools/testing/selftests/net/af_unix/Makefile +1 -0
@@ -16,6 +16,7 @@ TEST_GEN_PROGS := \ unix_connect \ unix_connreset \ unix_listen \ + unix_oob_zero_peek \ # end of TEST_GEN_PROGS TEST_GEN_FILES := scm_rights_denial_lsm.bpf.o
tools/testing/selftests/net/af_unix/unix_oob_zero_peek.c new file +89 -0
89 lines not on this page · raw message
Signature · 1 line
2.43.0
Kuniyuki Iwashima
maintainerQuoted 4 lines · Sahaj Chaudhari
A zero-length
MSG_PEEKon anAF_UNIXstream socket can busy-loop when an OOB skb is queued. Add a regression test that sendsMSG_OOBand checks thatrecv(..., 0, MSG_PEEK)returns promptly in a child process.
This is covered in msg_oob.c.
---
pw-bot: rejected