smb: client: fix ALIGN() overflow in symlink_data() error context loop
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 76894f3e2f71177747b8b4763fb180e800279585 · < 62656b024efc21c3230eade1a847f25871c3d2bb| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
smb: client: fix ALIGN() overflow in symlink_data() error context loop
The check added by commit 7d9a7f1f96cd ("smb/client: fix possible infinite loop and oob read in symlink_data()") compared the post-ALIGN length against the remaining buffer, but ALIGN() itself can overflow: for ErrorDataLength near UINT32_MAX (e.g. 0xFFFFFFF9), ALIGN(x, 8) wraps to 0, so the subsequent bounds check passes, and the loop advances by zero bytes leaving 'p' pointing into stale data.
Fix by checking the raw ErrorDataLength against the remaining space before applying ALIGN(), then checking again after. Since raw_len is bounded by the buffer, raw_len + 7 cannot overflow, so the second check is an exact post-alignment bounds guard.
From the CVE record · Linux
The Linux kernel SMB client can overflow an alignment calculation while processing a symlink error context with an ErrorDataLength near UINT32_MAX. This can bypass a bounds check and leave the loop advancing by zero bytes into stale data; the input does not specify attacker access requirements or user interaction.
Engineers running Linux kernels with the SMB client should check their exposure; affected versions are not specified.