Patch "NFSv4.2: fix return value of _nfs4_get_security_label()" has been added to the 5.11-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.2: fix return value of _nfs4_get_security_label()

to the 5.11-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.2-fix-return-value-of-_nfs4_get_security_label.patch
and it can be found in the queue-5.11 subdirectory.

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



commit ec3b2681ccbe25be791e79280d574d22bae1c402
Author: Ondrej Mosnacek <omosnace@xxxxxxxxxx>
Date:   Fri Jan 15 18:43:56 2021 +0100

    NFSv4.2: fix return value of _nfs4_get_security_label()
    
    [ Upstream commit 53cb245454df5b13d7063162afd7a785aed6ebf2 ]
    
    An xattr 'get' handler is expected to return the length of the value on
    success, yet _nfs4_get_security_label() (and consequently also
    nfs4_xattr_get_nfs4_label(), which is used as an xattr handler) returns
    just 0 on success.
    
    Fix this by returning label.len instead, which contains the length of
    the result.
    
    Fixes: aa9c2669626c ("NFS: Client implementation of Labeled-NFS")
    Signed-off-by: Ondrej Mosnacek <omosnace@xxxxxxxxxx>
    Reviewed-by: James Morris <jamorris@xxxxxxxxxxxxxxxxxxx>
    Reviewed-by: Paul Moore <paul@xxxxxxxxxxxxxx>
    Signed-off-by: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index fc8bbfd9beb3..7eb44f37558c 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5972,7 +5972,7 @@ static int _nfs4_get_security_label(struct inode *inode, void *buf,
 		return ret;
 	if (!(fattr.valid & NFS_ATTR_FATTR_V4_SECURITY_LABEL))
 		return -ENOENT;
-	return 0;
+	return label.len;
 }
 
 static int nfs4_get_security_label(struct inode *inode, void *buf,



[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