Patch "NFSv4/pnfs: minor fix for cleanup path in nfs4_get_device_info" has been added to the 5.15-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

    NFSv4/pnfs: minor fix for cleanup path in nfs4_get_device_info

to the 5.15-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:
     nfsv4-pnfs-minor-fix-for-cleanup-path-in-nfs4_get_device_info.patch
and it can be found in the queue-5.15 subdirectory.

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


>From 96562c45af5c31b89a197af28f79bfa838fb8391 Mon Sep 17 00:00:00 2001
From: Fedor Pchelkin <pchelkin@xxxxxxxxx>
Date: Thu, 20 Jul 2023 18:37:51 +0300
Subject: NFSv4/pnfs: minor fix for cleanup path in nfs4_get_device_info

From: Fedor Pchelkin <pchelkin@xxxxxxxxx>

commit 96562c45af5c31b89a197af28f79bfa838fb8391 upstream.

It is an almost improbable error case but when page allocating loop in
nfs4_get_device_info() fails then we should only free the already
allocated pages, as __free_page() can't deal with NULL arguments.

Found by Linux Verification Center (linuxtesting.org).

Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Fedor Pchelkin <pchelkin@xxxxxxxxx>
Reviewed-by: Benjamin Coddington <bcodding@xxxxxxxxxx>
Signed-off-by: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 fs/nfs/pnfs_dev.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/nfs/pnfs_dev.c
+++ b/fs/nfs/pnfs_dev.c
@@ -154,7 +154,7 @@ nfs4_get_device_info(struct nfs_server *
 		set_bit(NFS_DEVICEID_NOCACHE, &d->flags);
 
 out_free_pages:
-	for (i = 0; i < max_pages; i++)
+	while (--i >= 0)
 		__free_page(pages[i]);
 	kfree(pages);
 out_free_pdev:


Patches currently in stable-queue which might be from pchelkin@xxxxxxxxx are

queue-5.15/nfsv4-pnfs-minor-fix-for-cleanup-path-in-nfs4_get_device_info.patch
queue-5.15/wifi-ath9k-protect-wmi-command-response-buffer-repla.patch
queue-5.15/wifi-ath9k-fix-races-between-ath9k_wmi_cmd-and-ath9k.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