diff options
author | Oliver Hartkopp <[email protected]> | 2023-03-31 15:19:35 +0200 |
---|---|---|
committer | Marc Kleine-Budde <[email protected]> | 2023-04-05 11:16:37 +0200 |
commit | 051737439eaee5bdd03d3c2ef5510d54a478fd05 (patch) | |
tree | 4b07b9f7b07f389e022c62aeb1b790b16935ea9b /scripts/gdb/linux/rbtree.py | |
parent | 79e19fa79cb5d5f1b3bf3e3ae24989ccb93c7b7b (diff) |
can: isotp: fix race between isotp_sendsmg() and isotp_release()
As discussed with Dae R. Jeong and Hillf Danton here [1] the sendmsg()
function in isotp.c might get into a race condition when restoring the
former tx.state from the old_state.
Remove the old_state concept and implement proper locking for the
ISOTP_IDLE transitions in isotp_sendmsg(), inspired by a
simplification idea from Hillf Danton.
Introduce a new tx.state ISOTP_SHUTDOWN and use the same locking
mechanism from isotp_release() which resolves a potential race between
isotp_sendsmg() and isotp_release().
[1] https://lore.kernel.org/linux-can/ZB%2F93xJxq%2FBUqAgG@dragonet
v1: https://lore.kernel.org/all/[email protected]
v2: https://lore.kernel.org/all/[email protected]
take care of signal interrupts for wait_event_interruptible() in
isotp_release()
v3: https://lore.kernel.org/all/[email protected]
take care of signal interrupts for wait_event_interruptible() in
isotp_sendmsg() in the wait_tx_done case
v4: https://lore.kernel.org/all/[email protected]
take care of signal interrupts for wait_event_interruptible() in
isotp_sendmsg() in ALL cases
Cc: Dae R. Jeong <[email protected]>
Cc: Hillf Danton <[email protected]>
Signed-off-by: Oliver Hartkopp <[email protected]>
Fixes: 4f027cba8216 ("can: isotp: split tx timer into transmission and timeout")
Link: https://lore.kernel.org/all/[email protected]
Cc: [email protected]
[mkl: rephrase commit message]
Signed-off-by: Marc Kleine-Budde <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/rbtree.py')
0 files changed, 0 insertions, 0 deletions