xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Chong Li <lichong659@gmail.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Chong Li <chong.li@wustl.edu>, Wei Liu <wei.liu2@citrix.com>,
	Sisu Xi <xisisu@gmail.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	"dario.faggioli" <dario.faggioli@citrix.com>,
	xen-devel <xen-devel@lists.xen.org>,
	Meng Xu <mengxu@cis.upenn.edu>, Jan Beulich <jbeulich@suse.com>,
	Dagaen Golomb <dgolomb@seas.upenn.edu>
Subject: Re: [hypervisor deadlock] Re: [PATCH v9 for Xen 4.7 1/4] xen: enable per-VCPU parameter for RTDS
Date: Mon, 4 Apr 2016 10:58:36 -0500	[thread overview]
Message-ID: <CAGHO-iq3S3aZGYUn0KSMq5XebtC9RT_-PzrqNGxnasuRo8WOTg@mail.gmail.com> (raw)
In-Reply-To: <570284F0.5090201@citrix.com>

On Mon, Apr 4, 2016 at 10:14 AM, Andrew Cooper
<andrew.cooper3@citrix.com> wrote:
> On 01/04/16 05:59, Chong Li wrote:
>> diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
>> index 305889a..e5d15d8 100644
>> --- a/xen/common/sched_credit.c
>> +++ b/xen/common/sched_credit.c
>> @@ -1080,15 +1080,13 @@ csched_dom_cntl(
>>       * lock. Runq lock not needed anywhere in here. */
>>      spin_lock_irqsave(&prv->lock, flags);
>>
>> -    if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo )
>> +    switch ( op->cmd )
>>      {
>> +    case XEN_DOMCTL_SCHEDOP_getinfo:
>>          op->u.credit.weight = sdom->weight;
>>          op->u.credit.cap = sdom->cap;
>> -    }
>> -    else
>> -    {
>> -        ASSERT(op->cmd == XEN_DOMCTL_SCHEDOP_putinfo);
>> -
>> +        break;
>> +    case XEN_DOMCTL_SCHEDOP_putinfo:
>>          if ( op->u.credit.weight != 0 )
>>          {
>>              if ( !list_empty(&sdom->active_sdom_elem) )
>> @@ -1101,7 +1099,9 @@ csched_dom_cntl(
>>
>>          if ( op->u.credit.cap != (uint16_t)~0U )
>>              sdom->cap = op->u.credit.cap;
>> -
>> +        break;
>> +    default:
>> +        return -EINVAL;
>
> This path returns without unlocking prv->lock.
>
>>      }
>>
>>      spin_unlock_irqrestore(&prv->lock, flags);
>> diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
>> index 7ddad38..d48ed5a 100644
>> --- a/xen/common/sched_credit2.c
>> +++ b/xen/common/sched_credit2.c
>> @@ -1421,14 +1421,12 @@ csched2_dom_cntl(
>>       * runq lock to update csvcs. */
>>      spin_lock_irqsave(&prv->lock, flags);
>>
>> -    if ( op->cmd == XEN_DOMCTL_SCHEDOP_getinfo )
>> +    switch ( op->cmd )
>>      {
>> +    case XEN_DOMCTL_SCHEDOP_getinfo:
>>          op->u.credit2.weight = sdom->weight;
>> -    }
>> -    else
>> -    {
>> -        ASSERT(op->cmd == XEN_DOMCTL_SCHEDOP_putinfo);
>> -
>> +        break;
>> +    case XEN_DOMCTL_SCHEDOP_putinfo:
>>          if ( op->u.credit2.weight != 0 )
>>          {
>>              struct vcpu *v;
>> @@ -1457,6 +1455,9 @@ csched2_dom_cntl(
>>                  vcpu_schedule_unlock(lock, svc->vcpu);
>>              }
>>          }
>> +        break;
>> +    default:
>> +        return -EINVAL;
>
> As does this.
>
> Please submit a bugfix ASAP.  This will become a security vulnerability
> if Xen 4.7 is shipped without it being fixed.
>
>>      }
>>
>>      spin_unlock_irqrestore(&prv->lock, flags);
>
Thanks for pointing this out.

Dario, do you want to include this bugfix in your cleanup patch, or
let me submit this?

Chong


-- 
Chong Li
Department of Computer Science and Engineering
Washington University in St.louis

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-04-04 15:58 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01  4:59 [PATCH v9 for Xen 4.7 0/4] Enable per-VCPU parameter for RTDS Chong Li
2016-04-01  4:59 ` [PATCH v9 for Xen 4.7 1/4] xen: enable " Chong Li
2016-04-01  9:35   ` Jan Beulich
2016-04-01 12:37   ` Dario Faggioli
2016-04-04 15:14   ` [hypervisor deadlock] " Andrew Cooper
2016-04-04 15:58     ` Chong Li [this message]
2016-04-04 16:05       ` George Dunlap
2016-04-04 16:32         ` Dario Faggioli
2016-04-04 16:47           ` Wei Liu
2016-04-04 17:22             ` Chong Li
2016-04-01  4:59 ` [PATCH v9 for Xen 4.7 2/4] libxc: " Chong Li
2016-04-01  4:59 ` [PATCH v9 for Xen 4.7 3/4] libxl: " Chong Li
2016-04-01 12:53   ` Dario Faggioli
2016-04-01 13:40   ` Wei Liu
2016-04-06 14:32     ` Ian Jackson
2016-04-06 14:55       ` Ian Jackson
2016-04-06 15:04         ` Wei Liu
2016-04-06 15:22           ` Ian Jackson
2016-04-06 15:38             ` Ian Jackson
2016-04-06 16:36               ` Dario Faggioli
2016-04-06 16:41                 ` Chong Li
2016-04-06 18:54                   ` Andrew Cooper
2016-04-06 19:20                     ` Chong Li
2016-04-06 19:23                       ` Andrew Cooper
2016-04-06 19:30                       ` Wei Liu
2016-04-06 19:41                         ` Chong Li
2016-04-06 19:49                           ` Wei Liu
2016-04-06 20:01                             ` Dario Faggioli
2016-04-01  4:59 ` [PATCH v9 for Xen 4.7 4/4] xl: " Chong Li
2016-04-01 13:15   ` Dario Faggioli
2016-04-01 13:43     ` Wei Liu
2016-04-01 13:51       ` Dario Faggioli

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=CAGHO-iq3S3aZGYUn0KSMq5XebtC9RT_-PzrqNGxnasuRo8WOTg@mail.gmail.com \
    --to=lichong659@gmail.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=chong.li@wustl.edu \
    --cc=dario.faggioli@citrix.com \
    --cc=dgolomb@seas.upenn.edu \
    --cc=george.dunlap@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=mengxu@cis.upenn.edu \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=xisisu@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).