]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Jul 2025 13:53:26 +0000 (15:53 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Jul 2025 13:53:26 +0000 (15:53 +0200)
added patches:
ipmi-msghandler-fix-potential-memory-corruption-in-ipmi_create_user.patch
rxrpc-fix-oops-due-to-non-existence-of-prealloc-backlog-struct.patch

queue-6.6/ipmi-msghandler-fix-potential-memory-corruption-in-ipmi_create_user.patch [new file with mode: 0644]
queue-6.6/rxrpc-fix-oops-due-to-non-existence-of-prealloc-backlog-struct.patch [new file with mode: 0644]
queue-6.6/series

diff --git a/queue-6.6/ipmi-msghandler-fix-potential-memory-corruption-in-ipmi_create_user.patch b/queue-6.6/ipmi-msghandler-fix-potential-memory-corruption-in-ipmi_create_user.patch
new file mode 100644 (file)
index 0000000..942f2ff
--- /dev/null
@@ -0,0 +1,49 @@
+From fa332f5dc6fc662ad7d3200048772c96b861cf6b Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@linaro.org>
+Date: Mon, 5 May 2025 17:34:15 +0300
+Subject: ipmi:msghandler: Fix potential memory corruption in ipmi_create_user()
+
+From: Dan Carpenter <dan.carpenter@linaro.org>
+
+commit fa332f5dc6fc662ad7d3200048772c96b861cf6b upstream.
+
+The "intf" list iterator is an invalid pointer if the correct
+"intf->intf_num" is not found.  Calling atomic_dec(&intf->nr_users) on
+and invalid pointer will lead to memory corruption.
+
+We don't really need to call atomic_dec() if we haven't called
+atomic_add_return() so update the if (intf->in_shutdown) path as well.
+
+Fixes: 8e76741c3d8b ("ipmi: Add a limit on the number of users that may use IPMI")
+Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
+Message-ID: <aBjMZ8RYrOt6NOgi@stanley.mountain>
+Signed-off-by: Corey Minyard <corey@minyard.net>
+[ - Dropped change to the `if (intf->in_shutdown)` block since that logic
+    doesn't exist yet.
+  - Modified out_unlock to release the srcu lock instead of the mutex
+    since we don't have the mutex here yet. ]
+Signed-off-by: Brendan Jackman <jackmanb@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/char/ipmi/ipmi_msghandler.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/char/ipmi/ipmi_msghandler.c
++++ b/drivers/char/ipmi/ipmi_msghandler.c
+@@ -1241,7 +1241,7 @@ int ipmi_create_user(unsigned int
+       }
+       /* Not found, return an error */
+       rv = -EINVAL;
+-      goto out_kfree;
++      goto out_unlock;
+  found:
+       if (atomic_add_return(1, &intf->nr_users) > max_users) {
+@@ -1283,6 +1283,7 @@ int ipmi_create_user(unsigned int
+ out_kfree:
+       atomic_dec(&intf->nr_users);
++out_unlock:
+       srcu_read_unlock(&ipmi_interfaces_srcu, index);
+       vfree(new_user);
+       return rv;
diff --git a/queue-6.6/rxrpc-fix-oops-due-to-non-existence-of-prealloc-backlog-struct.patch b/queue-6.6/rxrpc-fix-oops-due-to-non-existence-of-prealloc-backlog-struct.patch
new file mode 100644 (file)
index 0000000..f3ccee3
--- /dev/null
@@ -0,0 +1,44 @@
+From 880a88f318cf1d2a0f4c0a7ff7b07e2062b434a4 Mon Sep 17 00:00:00 2001
+From: David Howells <dhowells@redhat.com>
+Date: Tue, 8 Jul 2025 22:15:04 +0100
+Subject: rxrpc: Fix oops due to non-existence of prealloc backlog struct
+
+From: David Howells <dhowells@redhat.com>
+
+commit 880a88f318cf1d2a0f4c0a7ff7b07e2062b434a4 upstream.
+
+If an AF_RXRPC service socket is opened and bound, but calls are
+preallocated, then rxrpc_alloc_incoming_call() will oops because the
+rxrpc_backlog struct doesn't get allocated until the first preallocation is
+made.
+
+Fix this by returning NULL from rxrpc_alloc_incoming_call() if there is no
+backlog struct.  This will cause the incoming call to be aborted.
+
+Reported-by: Junvyyang, Tencent Zhuque Lab <zhuque@tencent.com>
+Suggested-by: Junvyyang, Tencent Zhuque Lab <zhuque@tencent.com>
+Signed-off-by: David Howells <dhowells@redhat.com>
+cc: LePremierHomme <kwqcheii@proton.me>
+cc: Marc Dionne <marc.dionne@auristor.com>
+cc: Willy Tarreau <w@1wt.eu>
+cc: Simon Horman <horms@kernel.org>
+cc: linux-afs@lists.infradead.org
+Link: https://patch.msgid.link/20250708211506.2699012-3-dhowells@redhat.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/rxrpc/call_accept.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/net/rxrpc/call_accept.c
++++ b/net/rxrpc/call_accept.c
+@@ -254,6 +254,9 @@ static struct rxrpc_call *rxrpc_alloc_in
+       unsigned short call_tail, conn_tail, peer_tail;
+       unsigned short call_count, conn_count;
++      if (!b)
++              return NULL;
++
+       /* #calls >= #conns >= #peers must hold true. */
+       call_head = smp_load_acquire(&b->call_backlog_head);
+       call_tail = b->call_backlog_tail;
index 62df31108b58ea01b62966f9a06aa06401b1c2be..7ed3cb787a18b1019ebea3d0e59397a22ac1fa06 100644 (file)
@@ -29,3 +29,5 @@ x86-cpu-amd-properly-check-the-tsa-microcode.patch
 maple_tree-fix-ma_state_prealloc-flag-in-mas_preallocate.patch
 perf-build-setup-pkg_config_libdir-for-cross-compilation.patch
 bluetooth-hci-set-extended-advertising-data-synchronously.patch
+rxrpc-fix-oops-due-to-non-existence-of-prealloc-backlog-struct.patch
+ipmi-msghandler-fix-potential-memory-corruption-in-ipmi_create_user.patch