Description
In the Linux kernel, the following vulnerability has been resolved: smb: client: don't retry failed writes forever regardless of mount options smb2_writev_callback() marks a write for retry whenever the server fails it with a replayable status, ignoring smb2_should_replay() and so the hard and retrans mount options. The latter is only used to decide on a backoff, so on a soft mount with no retrans, a server that keeps failing a write with e.g. STATUS_INSUFFICIENT_RESOURCES gets it resent forever, thousands of times per second, hanging anything waiting on its writeback: smb3_write_err: R=005c359e[2] ... offset=0x27000 len=0xfdf0 rc=-11 (569410 times in 255 seconds, same subrequest, no growing delay) Only retry such writes when cifs_io_should_replay() allows it, as already done for send errors in smb2_async_writev(), otherwise let them fail. Writeback thus keeps retrying them with backoff, within its retry window. Base the decision on the result of this attempt rather than on wdata->result, which is never reset on success and may hold the error of a previous attempt. Writes cut short by a reconnect get retried regardless too. Have writeback ones go through cifs_io_should_replay() as well, so that they back off and soft mounts give up on them after the retry window, as on other replayable errors. Other writes cut short keep being retried, without spending the mount's retries, but as replays, since they may have reached the server, unless umount -f stopped them, which fails them with -EIO.
Affected products
Version statuses are supplied by the assigning organization. Consult the original record for detailed ranges and platform conditions.
Linux Linux
Default version status: unaffected
2c1238a7477a2e76a49161937fc20a04c74dbd76 to < 22561146f810eee83f4447fe900a48923f85e3dcaffected2c1238a7477a2e76a49161937fc20a04c74dbd76 to < bb203c9af62adb59d82e8ecb715e778329e3b771affected
Linux Linux
Default version status: affected
7.0affected0 to < 7.0unaffected7.3.7 to ≤ 7.3.*unaffected7.4-rc3 to ≤ *unaffected