On 27.08.2023 09:22:05, Lukas Magel wrote: > With patch [1], isotp_poll was updated to also queue the poller in the > so->wait queue, which is used for send state changes. Since the queue > now also contains polling tasks that are not interested in sending, the > queue fill state can no longer be used as an indication of send > readiness. As a consequence, nonblocking writes can lead to a race and > lock-up of the socket if there is a second task polling the socket in > parallel. > > With this patch, isotp_sendmsg does not consult wq_has_sleepers but > instead tries to atomically set so->tx.state and waits on so->wait if it > is unable to do so. This behavior is in alignment with isotp_poll, which > also checks so->tx.state to determine send readiness. > > V2: > - Revert direct exit to goto err_event_drop > > [1] https://lore.kernel.org/all/20230331125511.372783-1-michal.sojka@xxxxxxx > > Reported-by: Maxime Jayat <maxime.jayat@xxxxxxxxxxxxxxxxx> > Closes: https://lore.kernel.org/linux-can/11328958-453f-447f-9af8-3b5824dfb041@xxxxxxxx/ > Signed-off-by: Lukas Magel <lukas.magel@xxxxxxxxxx> Applied to linux-can/testing. Thanks, Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung Nürnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Attachment:
signature.asc
Description: PGP signature