From nobody Wed May 1 08:57:33 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.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 (zohomail.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=1583222626; cv=none; d=zohomail.com; s=zohoarc; b=BJuBwsULh5pb1iNDFzuHQv34ESHZhjhP4J8aJGu2VM/c3nGA6xBtrER4bN2GUC/mPZ+Cj1StJPpmxGG860AiPkMxoDFYoBGSdqWldkL/2udrIZ7sfqZOzsTx48hVrTAiGniipVqsET4Cm9h24ajcpu6rXZut0x/PbAvHaFQLPo0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583222626; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=uYPEMDhkXAUYOHu1Vgq6UGOYbYPRFeYx8TMB5dorfIY=; b=cAj7imuVjRAqae+22rrJsA7ahb+n5fl68u6/3VHAeIWfUvA2nA4pL6DLcifxBe0EKcdC/+HBVyOIfdJmPmwWINougvzhboCUUq7GWq+ZFCT05eg3Xd0IpWKO6+cXOTEErXZPX6UpKKod8S74MghiOuMUExkzsjVBMagX7PQekZ4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.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 1583222626098333.63589475017216; Tue, 3 Mar 2020 00:03:46 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j92WA-0005Y0-Oz; Tue, 03 Mar 2020 08:03:06 +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 1j92W8-0005Xs-UV for xen-devel@lists.xenproject.org; Tue, 03 Mar 2020 08:03:04 +0000 Received: from mx2.suse.de (unknown [195.135.220.15]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 66ff7e5d-5d25-11ea-a09c-12813bfff9fa; Tue, 03 Mar 2020 08:03:03 +0000 (UTC) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 43579AC1D; Tue, 3 Mar 2020 08:03:02 +0000 (UTC) X-Inumbo-ID: 66ff7e5d-5d25-11ea-a09c-12813bfff9fa X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Juergen Gross To: xen-devel@lists.xenproject.org Date: Tue, 3 Mar 2020 09:03:00 +0100 Message-Id: <20200303080300.12467-1-jgross@suse.com> X-Mailer: git-send-email 2.16.4 Subject: [Xen-devel] [PATCH] xen/sched: fix error path in cpupool_unassign_cpu_start() 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 , 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" In case moving away all domains from the cpu to be removed is failing in cpupool_unassign_cpu_start() the error path is missing to release sched_res_rculock. The normal exit path is releasing domlist_read_lock instead (this is currently no problem as the reference to the specific rcu lock is not used by rcu_read_unlock()). Reported-by: Igor Druzhinin Signed-off-by: Juergen Gross Reviewed-by: Jan Beulich --- xen/common/sched/cpupool.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c index b7721b5d02..4bf3d8434d 100644 --- a/xen/common/sched/cpupool.c +++ b/xen/common/sched/cpupool.c @@ -466,7 +466,7 @@ static int cpupool_unassign_cpu_start(struct cpupool *c= , unsigned int cpu) } rcu_read_unlock(&domlist_read_lock); if ( ret ) - goto out; + goto out_rcu; } cpupool_moving_cpu =3D cpu; atomic_inc(&c->refcnt); @@ -474,7 +474,8 @@ static int cpupool_unassign_cpu_start(struct cpupool *c= , unsigned int cpu) cpumask_andnot(c->cpu_valid, c->cpu_valid, cpus); cpumask_and(c->res_valid, c->cpu_valid, &sched_res_mask); =20 - rcu_read_unlock(&domlist_read_lock); +out_rcu: + rcu_read_unlock(&sched_res_rculock); out: spin_unlock(&cpupool_lock); =20 --=20 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel