[lvc-project] [PATCH] batman-adv: Broken sync while rescheduling delayed work

Sven Eckelmann sven at narfation.org
Fri May 26 19:49:21 MSK 2023


On Friday, 26 May 2023 18:16:32 CEST Vladislav Efanov wrote:
> The reason for these issues is the lack of synchronization. Delayed
> work (batadv_dat_purge) schedules new timer/work while the device
> is being deleted. As the result new timer/delayed work is set after
> cancel_delayed_work_sync() was called. So after the device is freed
> the timer list contains pointer to already freed memory.

You are most likely right but could you please point out what in the worker is 
checked by the workqueue code that prevents it from being scheduled again?  
(and which seems to be overwritten as your patch seems to suggest)

I think __cancel_work_timer marked the work as canceling but 
batadv_dat_start_timer reinitialized the worked (thus removing this important 
state). Would be nice if you could either correct me or confirm what I think to 
remember.

Kind regards,
	Sven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://linuxtesting.org/pipermail/lvc-project/attachments/20230526/b52c0c05/attachment.pgp>


More information about the lvc-project mailing list