Skip to contentSkip to conversation

smb: client: fix copy-paste error in WSL EA length accounting for $LXDEV

PATCH Applied Frank Sorenson 3 participants 3 messages Aug 20 – Aug 21

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smb: client: fix copy-paste error in WSL EA length accounting for $LXDEV

The LXDEV block in cifs_query_path_info() uses SMB2_WSL_XATTR_MODE_SIZE
(4) instead of SMB2_WSL_XATTR_DEV_SIZE (8), undercounting eas_len by 4 bytes per $LXDEV EA.

eas_len is used only as a zero/non-zero presence flag so there is no current functional impact, but the value is incorrect and misleading.

Fixes 97db41604555 ("smb: client: parse uid, gid, mode and dev from WSL reparse points")
Cc Paulo Alcantara <[email protected]>
---
 fs/smb/client/smb1ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/smb1ops.c +1 -1
index 7e2b29060f51..3ac4126267f6 100644
@@ -721,7 +721,7 @@ static int cifs_query_path_info(const unsigned int xid,
 			ea->ea_value_length = cpu_to_le16(SMB2_WSL_XATTR_DEV_SIZE);
 			memcpy(&ea->ea_data[0], SMB2_WSL_XATTR_DEV, SMB2_WSL_XATTR_NAME_LEN + 1);
 			data->wsl.eas_len += ALIGN(sizeof(*ea) + SMB2_WSL_XATTR_NAME_LEN + 1 +
-						   SMB2_WSL_XATTR_MODE_SIZE, 4);
+						   SMB2_WSL_XATTR_DEV_SIZE, 4);
 			rc = 0;
 		} else if (rc >= 0) {
 			/* It is an error if EA $LXDEV has wrong size. */
Signature · 1 line
2.55.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Frank Sorenson

The LXDEV block in cifs_query_path_info() uses SMB2_WSL_XATTR_MODE_SIZE
(4) instead of SMB2_WSL_XATTR_DEV_SIZE (8), undercounting eas_len by 4 bytes per $LXDEV EA.

Quoted 7 lines

eas_len is used only as a zero/non-zero presence flag so there is no current functional impact, but the value is incorrect and misleading.

Fixes 97db41604555 ("smb: client: parse uid, gid, mode and dev from WSL reparse points")
Cc Paulo Alcantara <[email protected]>

Thanks!

maintainer Applied
#2 lore raw
In reply to Frank Sorenson
Quoted 7 lines · Frank Sorenson

The LXDEV block in cifs_query_path_info() uses SMB2_WSL_XATTR_MODE_SIZE
(4) instead of SMB2_WSL_XATTR_DEV_SIZE (8), undercounting eas_len by 4 bytes per $LXDEV EA.

eas_len is used only as a zero/non-zero presence flag so there is no current functional impact, but the value is incorrect and misleading.
...

Applied.