Files
scoutfs/kmod/src
Auke Kok dc74104804 Drain conn workers before nulling client->conn in destroy
scoutfs_client_destroy nulled client->conn before scoutfs_net_free_conn
had a chance to drain the conn's workqueue.  An in-flight proc_worker
running client_lock_recover dispatches scoutfs_lock_recover_request
synchronously, which in turn calls scoutfs_client_lock_recover_response.
That helper reads client->conn and hands it to scoutfs_net_response, so
a racing NULL made submit_send dereference conn->lock and trip a KASAN
null-ptr-deref followed by a GPF.

Only became reachable in practice once reconnect started draining pending
client requests with -ECONNRESET, because the farewell can now return
while the server is still sending requests on the re-established socket.

Reorder so scoutfs_net_free_conn runs first; its shutdown_worker drains
conn->workq before any memory is freed, then client->conn is nulled.
The original intent of nulling to catch buggy late callers is preserved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 14:37:04 -07:00
..
2024-06-28 15:09:05 -07:00
2022-10-14 14:03:35 -07:00
2024-06-28 15:09:05 -07:00
2024-06-28 14:53:49 -07:00
2020-08-26 14:39:12 -07:00
2022-12-12 14:59:22 -08:00
2024-01-25 11:30:17 -08:00
2018-04-04 09:15:27 -05:00
2017-12-20 12:21:13 -08:00
2026-03-13 15:44:18 -07:00
2026-03-13 15:44:18 -07:00
2023-06-14 14:12:10 -07:00
2018-01-26 11:59:47 -08:00
2021-08-24 09:11:40 -07:00
2021-08-24 09:11:40 -07:00
2024-10-03 12:41:05 -07:00
2020-10-29 14:15:33 -07:00
2026-03-13 15:44:18 -07:00
2026-03-13 15:44:18 -07:00
2024-06-28 14:53:49 -07:00
2025-10-29 10:12:52 -07:00
2024-10-03 12:41:05 -07:00
2024-06-28 15:09:05 -07:00
2019-08-20 15:52:13 -07:00
2025-11-13 12:43:31 -08:00
2022-03-11 15:28:58 -08:00
2019-05-21 11:33:26 -07:00
2019-05-21 11:33:26 -07:00
2026-02-26 14:02:42 -05:00
2022-12-12 14:59:22 -08:00
2024-06-28 15:09:05 -07:00
2020-10-29 14:15:33 -07:00
2020-10-29 14:15:33 -07:00
2020-11-30 13:35:44 -08:00
2019-04-12 10:54:07 -07:00
2025-10-24 14:21:06 -04:00
2024-10-03 12:41:05 -07:00
2026-04-10 13:50:21 -07:00
2026-04-10 13:50:21 -07:00
2021-07-07 14:13:14 -07:00
2024-10-03 12:41:05 -07:00
2018-07-27 09:50:21 -07:00
2024-06-28 15:09:05 -07:00
2024-06-28 15:09:05 -07:00