summaryrefslogtreecommitdiff
path: root/tools/testing/shared/xarray-shared.c
diff options
context:
space:
mode:
authorJunyi Liu <moss80199@gmail.com>2026-05-18 23:27:19 +0900
committerSteve French <stfrench@microsoft.com>2026-05-21 18:18:49 -0500
commit3515503322f4819277091839eed46b695096aca5 (patch)
tree3ba1480aea9cefbdbd9b26aaa2389a28c437ba63 /tools/testing/shared/xarray-shared.c
parent1a2ab0feaa23147e347b4d4cb79cb3fc392118eb (diff)
ksmbd: fix durable reconnect error path file lifetime
After a durable reconnect succeeds, ksmbd_reopen_durable_fd() republishes the same ksmbd_file into the session volatile-id table. If smb2_open() then takes a later error path, cleanup first calls ksmbd_fd_put(work, fp) and then unconditionally calls ksmbd_put_durable_fd(dh_info.fp). In this case fp and dh_info.fp are the same object. The first put drops the reconnect lookup reference, but the final durable put can run __ksmbd_close_fd(NULL, fp). Because the final close is not session-aware, it can free the file object without removing the volatile-id entry that was just published into the session table. Use the session-aware put for the final reconnect drop when the reconnect had already succeeded and the error path is cleaning up the republished file. Earlier reconnect failures, before fp is assigned to dh_info.fp, keep using the durable-only put path. Fixes: 1baff47b81f9 ("ksmbd: fix use-after-free in smb2_open during durable reconnect") Signed-off-by: Junyi Liu <moss80199@gmail.com> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'tools/testing/shared/xarray-shared.c')
0 files changed, 0 insertions, 0 deletions