Patch "proc/vmcore: fix signedness bug in read_from_oldmem()" has been added to the 6.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    proc/vmcore: fix signedness bug in read_from_oldmem()

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     proc-vmcore-fix-signedness-bug-in-read_from_oldmem.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 641db40f3afe7998011bfabc726dba3e698f8196 Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Date: Tue, 25 Jul 2023 20:03:16 +0300
Subject: proc/vmcore: fix signedness bug in read_from_oldmem()

From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

commit 641db40f3afe7998011bfabc726dba3e698f8196 upstream.

The bug is the error handling:

	if (tmp < nr_bytes) {

"tmp" can hold negative error codes but because "nr_bytes" is type size_t
the negative error codes are treated as very high positive values
(success).  Fix this by changing "nr_bytes" to type ssize_t.  The
"nr_bytes" variable is used to store values between 1 and PAGE_SIZE and
they can fit in ssize_t without any issue.

Link: https://lkml.kernel.org/r/b55f7eed-1c65-4adc-95d1-6c7c65a54a6e@moroto.mountain
Fixes: 5d8de293c224 ("vmcore: convert copy_oldmem_page() to take an iov_iter")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Reviewed-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
Acked-by: Baoquan He <bhe@xxxxxxxxxx>
Cc: Dave Young <dyoung@xxxxxxxxxx>
Cc: Vivek Goyal <vgoyal@xxxxxxxxxx>
Cc: Alexey Dobriyan <adobriyan@xxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 fs/proc/vmcore.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/proc/vmcore.c
+++ b/fs/proc/vmcore.c
@@ -132,7 +132,7 @@ ssize_t read_from_oldmem(struct iov_iter
 			 u64 *ppos, bool encrypted)
 {
 	unsigned long pfn, offset;
-	size_t nr_bytes;
+	ssize_t nr_bytes;
 	ssize_t read = 0, tmp;
 	int idx;
 


Patches currently in stable-queue which might be from dan.carpenter@xxxxxxxxxx are

queue-6.4/soundwire-amd-fix-a-check-for-errors-in-probe.patch
queue-6.4/drm-amd-display-unlock-on-error-path-in-dm_handle_ms.patch
queue-6.4/phy-phy-mtk-dp-fix-an-error-code-in-probe.patch
queue-6.4/staging-ks7010-potential-buffer-overflow-in-ks_wlan_set_encode_ext.patch
queue-6.4/rdma-mlx4-make-check-for-invalid-flags-stricter.patch
queue-6.4/revert-usb-xhci-tegra-fix-error-check.patch
queue-6.4/tty-serial-sh-sci-fix-sleeping-in-atomic-context.patch
queue-6.4/proc-vmcore-fix-signedness-bug-in-read_from_oldmem.patch
queue-6.4/revert-usb-gadget-tegra-xudc-fix-error-check-in-tegra_xudc_powerdomain_init.patch
queue-6.4/phy-hisilicon-fix-an-out-of-bounds-check-in-hisi_inn.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux