pve-kernel/patches/kernel/0011-apparmor-expect-msg_namelen-0-for-recvmsg-calls.patch
Thomas Lamprecht 9ecdffc222 update source and patches to Ubuntu 25.04 Plucky based 6.14 kernel
Provide a newer – currently – opt-in kernel that will form the base
for Ubuntu's 25.04 release.

Using the current relevant tag Ubuntu-6.14.0-12.12 (the newer 13.13
tag includes only some packaging changes that do not affect us) from
the upstream repo [0].

Update the patches, drop those that got applied upstream or are simply
not relevant for the newer kernel anymore. Update the ZFS submodule to
include a cherry-pick of the two Linux 6.14 compat patches that
already got applied to ZFS upstream [1].

[0]: https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/plucky/
[1]: https://github.com/openzfs/zfs/pull/17026

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-03-28 14:27:55 +01:00

32 lines
1.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Wolfgang Bumiller <w.bumiller@proxmox.com>
Date: Wed, 10 Apr 2024 13:21:59 +0200
Subject: [PATCH] apparmor: expect msg_namelen=0 for recvmsg calls
When coming from sys_recvmsg, msg->msg_namelen is explicitly set to
zero early on. (see ____sys_recvmsg in net/socket.c)
We still end up in 'map_addr' where the assumption is that addr !=
NULL means addrlen has a valid size.
This is likely not a final fix, it was suggested by jjohansen on irc
to get things going until this is resolved properly.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
---
security/apparmor/af_inet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/apparmor/af_inet.c b/security/apparmor/af_inet.c
index e352652554d24543e822520305f07ea21149c7ac..b9c7f501aaaf38247b70b5b06f0e6eecbe08a230 100644
--- a/security/apparmor/af_inet.c
+++ b/security/apparmor/af_inet.c
@@ -738,7 +738,7 @@ int aa_inet_msg_perm(const char *op, u32 request, struct socket *sock,
/* do we need early bailout for !family ... */
return sk_has_perm2(sock->sk, op, request, profile, ad,
map_sock_addr(sock, ADDR_LOCAL, &laddr, &ad),
- map_addr(msg->msg_name, msg->msg_namelen, 0,
+ map_addr(msg->msg_namelen == 0 ? NULL : msg->msg_name, msg->msg_namelen, 0,
ADDR_REMOTE, &raddr, &ad),
profile_remote_perm(profile, sock->sk, request,
&raddr, &laddr.maddr, &ad));