All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jürgen Groß" <jgross@suse.com>
To: Furkan Caliskan <frn1furkan10@gmail.com>, xen-devel@lists.xenproject.org
Cc: jbeulich@suse.com, andrew.cooper3@citrix.com, dfaggioli@suse.com,
	gwd@xenproject.org
Subject: Re: [PATCH 2/2] xen/sched: core: kill unarmed timers on sched_init_vcpu() failure
Date: Tue, 18 Aug 2026 09:23:59 +0200	[thread overview]
Message-ID: <d4fc3ae9-e048-4e66-bd18-d4a7a2024dd6@suse.com> (raw)
In-Reply-To: <20260818063259.18733-3-frn1furkan10@gmail.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 1403 bytes --]

On 18.08.26 08:32, Furkan Caliskan wrote:
> sched_init_vcpu() calls init_timer() for a vcpu's periodic_timer,
> singleshot_timer and poll_timer before it can fail -- these
> become live, linked into their target pCPU's per-cpu timer list
> regardless of what happens next. If the sched_alloc_udata() call
> further down then fails, the function frees the sched_unit via
> sched_free_unit() and returns 1, but never unlinks these three
> timers.
> 
> The caller, vcpu_create(), does worse: on sched_init_vcpu()
> returning nonzero it jumps to fail_wq, skipping fail_sched and
> thus sched_destroy_vcpu() -- the only function on this path that
> calls kill_timer() on them. vcpu_destroy() then frees the vcpu,
> and the three timers embedded in it, while they are still linked
> into that shared list.
> 
> This silently corrupts that list. It only shows up later, when
> something else touches a neighboring timer: sched_move_domain()
> crashed with "Assertion 'entry->prev->next == entry' failed" on a
> completely unrelated, valid vcpus's timer.
> 
> Kill all three timers in sched_init_vcpu()'s own failure branch,
> so it doesn't depend on the caller reaching sched_destroy_vcpu()
> to undo what it set up itself.
> 
> Signed-off-by: Furkan Caliskan <frn1furkan10@gmail.com>

Apart from the missing Fixes: tag:

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2026-08-18  7:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18  6:32 [PATCH 0/2] xen/sched: fix crashes when vcpu creation fails Furkan Caliskan
2026-08-18  6:32 ` [PATCH 1/2] xen/sched: core: skip missing vcpu slots in sched_move_domain() Furkan Caliskan
2026-08-18  7:11   ` Jürgen Groß
2026-08-18  7:53     ` Furkan Çalışkan
2026-08-18 10:04       ` Andrew Cooper
2026-08-18 10:13         ` Jürgen Groß
2026-08-18 10:35           ` Andrew Cooper
2026-08-18 10:47             ` Juergen Gross
2026-08-18 10:53             ` Jan Beulich
2026-08-18 12:12               ` Furkan Çalışkan
2026-08-18 12:19                 ` Jan Beulich
2026-08-18  6:32 ` [PATCH 2/2] xen/sched: core: kill unarmed timers on sched_init_vcpu() failure Furkan Caliskan
2026-08-18  7:23   ` Jürgen Groß [this message]
2026-08-18  6:48 ` [PATCH 0/2] xen/sched: fix crashes when vcpu creation fails Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d4fc3ae9-e048-4e66-bd18-d4a7a2024dd6@suse.com \
    --to=jgross@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dfaggioli@suse.com \
    --cc=frn1furkan10@gmail.com \
    --cc=gwd@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.