summaryrefslogtreecommitdiff
path: root/net/can/j1939/socket.c
diff options
context:
space:
mode:
authorChengfeng Ye <dg573847474@gmail.com>2026-02-11 19:13:29 +0000
committerJakub Kicinski <kuba@kernel.org>2026-02-13 12:30:28 -0800
commitee5492fd88cfc079c19fbeac78e9e53b7f6c04f3 (patch)
tree2341d41d5d85fdf8f9f79ce7fbfe4ae7723ea047 /net/can/j1939/socket.c
parent36e838630c111a510f47e49d559bd26aba7d9a1b (diff)
fbnic: close fw_log race between users and teardowndavem/net/maindavem/net/HEAD
Fixes a theoretical race on fw_log between the teardown path and fw_log write functions. fw_log is written inside fbnic_fw_log_write() and can be reached from the mailbox handler fbnic_fw_msix_intr(), but fw_log is freed before IRQ/MBX teardown during cleanup, resulting in a potential data race of dereferencing a freed/null variable. Possible Interleaving Scenario: CPU0: fbnic_fw_msix_intr() // Entry fbnic_fw_log_write() if (fbnic_fw_log_ready()) // true ... preempt ... CPU1: fbnic_remove() // Entry fbnic_fw_log_free() vfree(log->data_start); log->data_start = NULL; CPU0: continues, walks log->entries or writes to log->data_start The initialization also has an incorrect order problem, as the fw_log is currently allocated after MBX setup during initialization. Fix the problems by adjusting the synchronization order to put initialization in place before the mailbox is enabled, and not cleared until after the mailbox has been disabled. Fixes: ecc53b1b46c89 ("eth: fbnic: Enable firmware logging") Signed-off-by: Chengfeng Ye <dg573847474@gmail.com> Link: https://patch.msgid.link/20260211191329.530886-1-dg573847474@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/can/j1939/socket.c')
0 files changed, 0 insertions, 0 deletions