Files
linux/security/landlock
Matthieu Buffet e4d82cbce2 landlock: Fix TCP handling of short AF_UNSPEC addresses
current_check_access_socket() treats AF_UNSPEC addresses as
AF_INET ones, and only later adds special case handling to
allow connect(AF_UNSPEC), and on IPv4 sockets
bind(AF_UNSPEC+INADDR_ANY).
This would be fine except AF_UNSPEC addresses can be as
short as a bare AF_UNSPEC sa_family_t field, and nothing
more. The AF_INET code path incorrectly enforces a length of
sizeof(struct sockaddr_in) instead.

Move AF_UNSPEC edge case handling up inside the switch-case,
before the address is (potentially incorrectly) treated as
AF_INET.

Fixes: fff69fb03d ("landlock: Support network rules with TCP bind and connect")
Signed-off-by: Matthieu Buffet <matthieu@buffet.re>
Link: https://lore.kernel.org/r/20251027190726.626244-4-matthieu@buffet.re
Signed-off-by: Mickaël Salaün <mic@digikod.net>
2025-12-26 20:38:56 +01:00
..
2025-03-26 13:59:34 +01:00
2025-03-26 13:59:42 +01:00
2024-02-27 11:21:45 +01:00
2025-04-08 19:18:20 +02:00
2025-12-26 20:38:53 +01:00
2025-03-26 13:59:42 +01:00
2025-06-27 10:10:37 +02:00
2025-03-26 13:59:34 +01:00
2024-02-27 11:21:45 +01:00
2022-05-09 12:31:10 +02:00
2022-05-09 12:31:10 +02:00
2025-03-21 12:12:19 +01:00
2025-03-26 13:59:42 +01:00