smb3: check xattr value length earlier
authorSteve French <stfrench@microsoft.com>
Tue, 12 Jul 2022 16:43:44 +0000 (11:43 -0500)
committerSteve French <stfrench@microsoft.com>
Mon, 1 Aug 2022 06:34:44 +0000 (01:34 -0500)
commit5fa2cffba0b82336a2244d941322eb1627ff787b
treebd80b7d35630355cea0739b43c1df43cbd217151
parent3d7cb6b04c3f3115719235cc6866b10326de34cd
smb3: check xattr value length earlier

Coverity complains about assigning a pointer based on
value length before checking that value length goes
beyond the end of the SMB.  Although this is even more
unlikely as value length is a single byte, and the
pointer is not dereferenced until laterm, it is clearer
to check the lengths first.

Addresses-Coverity: 1467704 ("Speculative execution data leak")
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2ops.c