ksmbd: fix use-after-free in smb2_open during durable reconnect
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: fix use-after-free in smb2_open during durable reconnect
In smb2_open, the call to ksmbd_put_durable_fd(fp) drops the reference to the durable file descriptor early during the durable reconnect process. If an error occurs subsequently (eg, ksmbd_iov_pin_rsp fails) or a scavenger accesses the file, it leads to a use-after-free when accessing fp properties (eg fp->create_time).
Move the single put to the end of the function below err_out2 so fp stays valid until smb2_open returns.
From the CVE record · Linux
The Linux kernel's ksmbd smb2_open can release a durable file descriptor too early during a durable reconnect. If a subsequent error occurs or a scavenger accesses the file, accessing the descriptor can cause a use-after-free. The input does not specify authentication or user-interaction requirements.
Engineers running the Linux kernel with ksmbd should check their deployments; affected versions are not specified.