[lvc-project] [PATCH] virt: vbox: fix possible circular timer scheduling

Aleksey Simakov bigalex934 at gmail.com
Sat Nov 22 21:31:36 MSK 2025


Прошу прощения, подумал, что предложили заменить весь абзац

сб, 22 нояб. 2025 г. в 21:29, Fedor Pchelkin <pchelkin at ispras.ru>:
>
> On Sat, 22. Nov 21:21, Alexey Simakov wrote:
>
> А куда пропало предложение ниже?  Я его не цитировал и его стоило оставить,
> иначе непонятно откуда берётся 'this function'.
>
> During driver cleanup, the timer is stopped using timer_delete_sync().
>
> Переотправлять пока не надо, если мэйнтейнеры не попросят.
>
> > According to timer.c documentation, callers of this function should ensure
> > the timer is not rearmed.  Meanwhile, the heartbeat callback may itself
> > reschedule the heartbeat timer which could lead to theoretically
> > indefinite loop iterations inside __timer_delete_sync(), due to a race
> > when the heartbeat callback is always running when it's attempted to be
> > detached.
> >
> > Use timer_shutdown_sync() instead to avoid this issue.
> >
> > Found by Linux Verification Center (linuxtesting.org) with SVACE.
> >
> > Fixes: 0ba002bc4393 ("virt: Add vboxguest driver for Virtual Box Guest integration"):
> > Signed-off-by: Alexey Simakov <bigalex934 at gmail.com>
> > ---
> >  drivers/virt/vboxguest/vboxguest_core.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/virt/vboxguest/vboxguest_core.c b/drivers/virt/vboxguest/vboxguest_core.c
> > index b177a534b6a4..508ba711669d 100644
> > --- a/drivers/virt/vboxguest/vboxguest_core.c
> > +++ b/drivers/virt/vboxguest/vboxguest_core.c
> > @@ -495,7 +495,7 @@ static int vbg_heartbeat_init(struct vbg_dev *gdev)
> >   */
> >  static void vbg_heartbeat_exit(struct vbg_dev *gdev)
> >  {
> > -     timer_delete_sync(&gdev->heartbeat_timer);
> > +     timer_shutdown_sync(&gdev->heartbeat_timer);
> >       vbg_heartbeat_host_config(gdev, false);
> >       vbg_req_free(gdev->guest_heartbeat_req,
> >                    sizeof(*gdev->guest_heartbeat_req));
> > --
> > 2.34.1
> >
> >
> > _______________________________________________
> > lvc-project mailing list
> > lvc-project at linuxtesting.org
> > http://linuxtesting.org/cgi-bin/mailman/listinfo/lvc-project



More information about the lvc-project mailing list