From nobody Tue Nov 11 08:45:25 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1569395189; cv=none; d=zoho.com; s=zohoarc; b=VambKIE61ZCiXXDCgGvprfi/CRYHbgZPSxIe6nK7tyiBZd5oHaah4fuzQpf8qRKlQC2BAiwIrEOx4P8CtGfqcKIMll5p65SvFJvUeuhWUlxJcYylYTie0hozW+j77833ad5BDjx7JiVzRZYtYpdolWIuPRuXjqIKohcFhc0zh9M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1569395189; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=eCdYLdZpEVG0B0KDLaisUFEU90eUSKrLUngrsARNZ8g=; b=G22qRlOk23xg+Pq2BRZgfYrdj+d6gcpne9mMdyLiKuffspcxS+g6xNH/NvpjewPXfuZczAsOEg36eu92eoQysXlw27SstOMZ5Z8VvaG5jCqMvCnwZQaTR77GdgzaxGo9zv4KOKo+s1wODsVlAog3kj3iwRVEnGl97dfYzNmjG6o= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1569395189813364.05854534716286; Wed, 25 Sep 2019 00:06:29 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iD1MQ-00081w-1Z; Wed, 25 Sep 2019 07:05:14 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iD1MO-000814-KH for xen-devel@lists.xenproject.org; Wed, 25 Sep 2019 07:05:12 +0000 Received: from mx1.suse.de (unknown [195.135.220.15]) by localhost (Halon) with ESMTPS id cdcb0dc2-df62-11e9-962b-12813bfff9fa; Wed, 25 Sep 2019 07:05:06 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 17180AE78; Wed, 25 Sep 2019 07:05:06 +0000 (UTC) X-Inumbo-ID: cdcb0dc2-df62-11e9-962b-12813bfff9fa X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Wed, 25 Sep 2019 09:05:02 +0200 Message-Id: <20190925070503.13850-2-jgross@suse.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190925070503.13850-1-jgross@suse.com> References: <20190925070503.13850-1-jgross@suse.com> Subject: [Xen-devel] [PATCH 1/2] xen/sched: fix locking in a653sched_free_vdata() X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , George Dunlap , Josh Whitehead , Robert VanVossen , Dario Faggioli MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" The arinc653 scheduler's free_vdata() function is missing proper locking: as it is modifying the scheduler's private vcpu list it needs to take the scheduler lock during that operation. Signed-off-by: Juergen Gross Reviewed-by: Dario Faggioli Reviewed-by: Jan Beulich --- xen/common/sched_arinc653.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c index 72b988ea5f..d47b747ef4 100644 --- a/xen/common/sched_arinc653.c +++ b/xen/common/sched_arinc653.c @@ -442,16 +442,22 @@ a653sched_alloc_vdata(const struct scheduler *ops, st= ruct vcpu *vc, void *dd) static void a653sched_free_vdata(const struct scheduler *ops, void *priv) { + a653sched_priv_t *sched_priv =3D SCHED_PRIV(ops); arinc653_vcpu_t *av =3D priv; + unsigned long flags; =20 if (av =3D=3D NULL) return; =20 + spin_lock_irqsave(&sched_priv->lock, flags); + if ( !is_idle_vcpu(av->vc) ) list_del(&av->list); =20 xfree(av); update_schedule_vcpus(ops); + + spin_unlock_irqrestore(&sched_priv->lock, flags); } =20 /** --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel