]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jan 2024 00:05:07 +0000 (16:05 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jan 2024 00:05:07 +0000 (16:05 -0800)
added patches:
net-bpf-avoid-unused-sin_addr_len-warning-when-config_cgroup_bpf-is-not-set.patch

queue-6.6/net-bpf-avoid-unused-sin_addr_len-warning-when-config_cgroup_bpf-is-not-set.patch [new file with mode: 0644]
queue-6.6/series

diff --git a/queue-6.6/net-bpf-avoid-unused-sin_addr_len-warning-when-config_cgroup_bpf-is-not-set.patch b/queue-6.6/net-bpf-avoid-unused-sin_addr_len-warning-when-config_cgroup_bpf-is-not-set.patch
new file mode 100644 (file)
index 0000000..5512258
--- /dev/null
@@ -0,0 +1,38 @@
+From 9c1292eca243821249fa99f40175b0660d9329e3 Mon Sep 17 00:00:00 2001
+From: Martin KaFai Lau <martin.lau@kernel.org>
+Date: Fri, 13 Oct 2023 11:57:02 -0700
+Subject: net/bpf: Avoid unused "sin_addr_len" warning when CONFIG_CGROUP_BPF is not set
+
+From: Martin KaFai Lau <martin.lau@kernel.org>
+
+commit 9c1292eca243821249fa99f40175b0660d9329e3 upstream.
+
+It was reported that there is a compiler warning on the unused variable
+"sin_addr_len" in af_inet.c when CONFIG_CGROUP_BPF is not set.
+This patch is to address it similar to the ipv6 counterpart
+in inet6_getname(). It is to "return sin_addr_len;"
+instead of "return sizeof(*sin);".
+
+Fixes: fefba7d1ae19 ("bpf: Propagate modified uaddrlen from cgroup sockaddr programs")
+Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
+Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
+Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
+Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
+Link: https://lore.kernel.org/bpf/20231013185702.3993710-1-martin.lau@linux.dev
+Closes: https://lore.kernel.org/bpf/20231013114007.2fb09691@canb.auug.org.au/
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv4/af_inet.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/ipv4/af_inet.c
++++ b/net/ipv4/af_inet.c
+@@ -823,7 +823,7 @@ int inet_getname(struct socket *sock, st
+       }
+       release_sock(sk);
+       memset(sin->sin_zero, 0, sizeof(sin->sin_zero));
+-      return sizeof(*sin);
++      return sin_addr_len;
+ }
+ EXPORT_SYMBOL(inet_getname);
index 27cc82de5bb6f6842c5750b4170206d7dbb4c771..230cd632636e6484ed238cd644055d9b22ef0141 100644 (file)
@@ -270,3 +270,4 @@ drm-amd-display-align-the-returned-error-code-with-legacy-dp.patch
 drm-amd-display-fix-late-derefrence-dsc-check-in-link_set_dsc_pps_packet.patch
 drm-amdgpu-pm-fix-the-power-source-flag-error.patch
 drm-amd-display-fix-uninitialized-variable-usage-in-core_link_-read_dpcd-write_dpcd-functions.patch
+net-bpf-avoid-unused-sin_addr_len-warning-when-config_cgroup_bpf-is-not-set.patch