Patch "afs: Fix overwriting of result of DNS query" has been added to the 5.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

    afs: Fix overwriting of result of DNS query

to the 5.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:
     afs-fix-overwriting-of-result-of-dns-query.patch
and it can be found in the queue-5.4 subdirectory.

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



commit 559bb29ba7951bcfed0e58d8aad6f8553eaf54df
Author: David Howells <dhowells@xxxxxxxxxx>
Date:   Thu Dec 21 15:09:31 2023 +0000

    afs: Fix overwriting of result of DNS query
    
    [ Upstream commit a9e01ac8c5ff32669119c40dfdc9e80eb0b7d7aa ]
    
    In afs_update_cell(), ret is the result of the DNS lookup and the errors
    are to be handled by a switch - however, the value gets clobbered in
    between by setting it to -ENOMEM in case afs_alloc_vlserver_list()
    fails.
    
    Fix this by moving the setting of -ENOMEM into the error handling for
    OOM failure.  Further, only do it if we don't have an alternative error
    to return.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.  Based
    on a patch from Anastasia Belova [1].
    
    Fixes: d5c32c89b208 ("afs: Fix cell DNS lookup")
    Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
    Reviewed-by: Jeffrey Altman <jaltman@xxxxxxxxxxxx>
    cc: Anastasia Belova <abelova@xxxxxxxxxxxxx>
    cc: Marc Dionne <marc.dionne@xxxxxxxxxxxx>
    cc: linux-afs@xxxxxxxxxxxxxxxxxxx
    cc: lvc-project@xxxxxxxxxxxxxxxx
    Link: https://lore.kernel.org/r/20231221085849.1463-1-abelova@xxxxxxxxxxxxx/ [1]
    Link: https://lore.kernel.org/r/1700862.1703168632@xxxxxxxxxxxxxxxxxxxxxx/ # v1
    Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/afs/cell.c b/fs/afs/cell.c
index 296b489861a9a..1522fadd8d2d2 100644
--- a/fs/afs/cell.c
+++ b/fs/afs/cell.c
@@ -404,10 +404,12 @@ static int afs_update_cell(struct afs_cell *cell)
 		if (ret == -ENOMEM)
 			goto out_wake;
 
-		ret = -ENOMEM;
 		vllist = afs_alloc_vlserver_list(0);
-		if (!vllist)
+		if (!vllist) {
+			if (ret >= 0)
+				ret = -ENOMEM;
 			goto out_wake;
+		}
 
 		switch (ret) {
 		case -ENODATA:




[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