* + drivers-rapidio-rio_cmc-prevent-possible-used-uninitialized.patch added to mm-hotfixes-unstable branch
@ 2025-06-08 0:47 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-06-08 0:47 UTC (permalink / raw)
To: mm-commits, torvalds, mporter, maherazz04, alex.bou9, akpm, akpm
The patch titled
Subject: drivers/rapidio/rio_cm.c: prevent possible used-uninitialized
has been added to the -mm mm-hotfixes-unstable branch. Its filename is
drivers-rapidio-rio_cmc-prevent-possible-used-uninitialized.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/drivers-rapidio-rio_cmc-prevent-possible-used-uninitialized.patch
This patch will later appear in the mm-hotfixes-unstable branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Andrew Morton <akpm@linux-foundation.org>
Subject: drivers/rapidio/rio_cm.c: prevent possible used-uninitialized
Date: Sat Jun 7 05:43:18 PM PDT 2025
In
riocm_cdev_ioctl(RIO_CM_CHAN_SEND)
-> cm_chan_msg_send()
-> riocm_ch_send()
cm_chan_msg_send() checks that userspace didn't send too much data but
riocm_ch_send() failed to check that userspace sent sufficient data. The
result is that riocm_ch_send() can access fields in the rio_ch_chan_hdr
which were never copied in from userspace.
Address this by teaching riocm_ch_send() to check that the entire
rio_ch_chan_hdr was copied in from userspace.
Reported-by: maher azz <maherazz04@gmail.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Alexandre Bounine <alex.bou9@gmail.com>
Cc: Linus Torvalds <torvalds@linuxfoundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/rapidio/rio_cm.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/rapidio/rio_cm.c~drivers-rapidio-rio_cmc-prevent-possible-used-uninitialized
+++ a/drivers/rapidio/rio_cm.c
@@ -783,6 +783,9 @@ static int riocm_ch_send(u16 ch_id, void
if (buf == NULL || ch_id == 0 || len == 0 || len > RIO_MAX_MSG_SIZE)
return -EINVAL;
+ if (len < sizeof(struct rio_ch_chan_hdr))
+ return -EINVAL; /* insufficient data from user */
+
ch = riocm_get_channel(ch_id);
if (!ch) {
riocm_error("%s(%d) ch_%d not found", current->comm,
_
Patches currently in -mm which might be from akpm@linux-foundation.org are
docs-proc-update-vmflags-documentation-in-smaps-fix.patch
fs-proc-task_mmu-add-vm_shadow_stack-for-arm64-when-support-gcs-fix.patch
drivers-rapidio-rio_cmc-prevent-possible-used-uninitialized.patch
mm-add-zblock-allocator-fix.patch
mm-add-zblock-allocator-fix-2.patch
mm-add-zblock-allocator-fix-2-fix.patch
mm-add-zblock-allocator-fix-3.patch
mm-zblock-avoid-failing-the-build-fix.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-06-08 0:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-08 0:47 + drivers-rapidio-rio_cmc-prevent-possible-used-uninitialized.patch added to mm-hotfixes-unstable branch Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.