From: Matthieu Buffet <matthieu@buffet.re>
To: "Mickaël Salaün" <mic@digikod.net>
Cc: "Günther Noack" <gnoack@google.com>,
linux-security-module@vger.kernel.org,
"Mikhail Ivanov" <ivanov.mikhail1@huawei-partners.com>,
"Konstantin Meskhidze" <konstantin.meskhidze@huawei.com>,
"Matthieu Buffet" <matthieu@buffet.re>
Subject: [RFC PATCH v1 0/3] Fix TCP short AF_UNSPEC handling
Date: Mon, 27 Oct 2025 20:07:23 +0100 [thread overview]
Message-ID: <20251027190726.626244-1-matthieu@buffet.re> (raw)
Hi Mickaël, Günther, Konstantin, Mikhail,
Here's a small fix for userland behaviour+error consistency in TCP, in
the edge case where userland uses an AF_UNSPEC address consisting of
just a bare sa_family_t.
First two commits fix/add test cases (which then fail), and third commit
patches current_check_access_socket() to make these tests pass. There's
more than one way to patch it, I just chose this because it should also
make it easier to merge UDP support (soon if this goes well).
Feedback welcome!
Matthieu Buffet (3):
selftests/landlock: Fix TCP bind(AF_UNSPEC) test case
selftests/landlock: Add missing connect(minimal AF_UNSPEC) test
landlock: Fix TCP handling of short AF_UNSPEC addresses
security/landlock/net.c | 118 +++++++++++---------
tools/testing/selftests/landlock/common.h | 1 +
tools/testing/selftests/landlock/net_test.c | 30 ++++-
3 files changed, 96 insertions(+), 53 deletions(-)
base-commit: 6dde339a3df80a57ac3d780d8cfc14d9262e2acd
--
2.47.2
next reply other threads:[~2025-10-27 18:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-27 19:07 Matthieu Buffet [this message]
2025-10-27 19:07 ` [RFC PATCH v1 1/3] selftests/landlock: Fix TCP bind(AF_UNSPEC) test case Matthieu Buffet
2025-10-27 19:07 ` [RFC PATCH v1 2/3] selftests/landlock: Add missing connect(minimal AF_UNSPEC) test Matthieu Buffet
2025-10-27 19:07 ` [RFC PATCH v1 3/3] landlock: Fix TCP handling of short AF_UNSPEC addresses Matthieu Buffet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251027190726.626244-1-matthieu@buffet.re \
--to=matthieu@buffet.re \
--cc=gnoack@google.com \
--cc=ivanov.mikhail1@huawei-partners.com \
--cc=konstantin.meskhidze@huawei.com \
--cc=linux-security-module@vger.kernel.org \
--cc=mic@digikod.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).