* [PATCH 0/2] Fix crashes with arinc653 cpupools
@ 2013-10-31 20:47 Nathan Studer
2013-10-31 20:47 ` [PATCH 1/2] Fix sched_priv corruption in ARINC653 alloc_vdata Nathan Studer
2013-10-31 20:47 ` [PATCH 2/2] Fix NULL pointer dereference in ARINC653 free_vdata Nathan Studer
0 siblings, 2 replies; 13+ messages in thread
From: Nathan Studer @ 2013-10-31 20:47 UTC (permalink / raw)
To: xen-devel; +Cc: george.dunlap, smartin, Nathan Studer, robert.vanvossen
From: Nathan Studer <nate.studer@dornerworks.com>
The ARINC653 scheduler's vdata_alloc and vdata_free functions
contain a number of errors which cause the hypervisor
to crash when using the ARINC653 scheduler with cpupools.
Nathan Studer (2):
Fix sched_priv corruption in ARINC653 alloc_vdata.
Fix NULL pointer dereference in ARINC653 free_vdata.
xen/common/sched_arinc653.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 1/2] Fix sched_priv corruption in ARINC653 alloc_vdata.
2013-10-31 20:47 [PATCH 0/2] Fix crashes with arinc653 cpupools Nathan Studer
@ 2013-10-31 20:47 ` Nathan Studer
2013-11-01 13:53 ` Andrew Cooper
2013-11-04 15:49 ` George Dunlap
2013-10-31 20:47 ` [PATCH 2/2] Fix NULL pointer dereference in ARINC653 free_vdata Nathan Studer
1 sibling, 2 replies; 13+ messages in thread
From: Nathan Studer @ 2013-10-31 20:47 UTC (permalink / raw)
To: xen-devel; +Cc: george.dunlap, smartin, Nathan Studer, robert.vanvossen
From: Nathan Studer <nate.studer@dornerworks.com>
The ARINC653 scheduler was directly assigning and manipulating
the sched_priv field of a vcpu in its alloc_vdata function.
When creating a cpu pool, this resulted in the corruption
of the sched_priv field of the vcpu, which was then passed
to the initial scheduler's free_vdata function with
disastrous results.
Signed-off-by: Nathan Studer <nate.studer@dornerworks.com>
---
xen/common/sched_arinc653.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
index 2502192..a1d9443 100644
--- a/xen/common/sched_arinc653.c
+++ b/xen/common/sched_arinc653.c
@@ -380,11 +380,14 @@ a653sched_deinit(const struct scheduler *ops)
static void *
a653sched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
{
+ arinc653_vcpu_t *svc;
+
/*
* Allocate memory for the ARINC 653-specific scheduler data information
* associated with the given VCPU (vc).
- */
- if ( (vc->sched_priv = xmalloc(arinc653_vcpu_t)) == NULL )
+ */
+ svc = xmalloc(arinc653_vcpu_t);
+ if ( svc == NULL )
return NULL;
/*
@@ -393,13 +396,13 @@ a653sched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
* will call the vcpu_wake scheduler callback function and our scheduler
* will mark the VCPU awake.
*/
- AVCPU(vc)->vc = vc;
- AVCPU(vc)->awake = 0;
+ svc->vc = vc;
+ svc->awake = 0;
if ( !is_idle_vcpu(vc) )
- list_add(&AVCPU(vc)->list, &SCHED_PRIV(ops)->vcpu_list);
+ list_add(&svc->list, &SCHED_PRIV(ops)->vcpu_list);
update_schedule_vcpus(ops);
- return AVCPU(vc);
+ return svc;
}
/**
--
1.7.9.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH 2/2] Fix NULL pointer dereference in ARINC653 free_vdata.
2013-10-31 20:47 [PATCH 0/2] Fix crashes with arinc653 cpupools Nathan Studer
2013-10-31 20:47 ` [PATCH 1/2] Fix sched_priv corruption in ARINC653 alloc_vdata Nathan Studer
@ 2013-10-31 20:47 ` Nathan Studer
2013-11-01 13:56 ` Andrew Cooper
1 sibling, 1 reply; 13+ messages in thread
From: Nathan Studer @ 2013-10-31 20:47 UTC (permalink / raw)
To: xen-devel; +Cc: george.dunlap, smartin, Nathan Studer, robert.vanvossen
From: Nathan Studer <nate.studer@dornerworks.com>
The ARINC653 scheduler alloc_vdata function does not add the
idle cpu to its internal vcpu_list, but when the free_vdata
function is called, the scheduler attempted to remove the vcpu
from its internal vcpu_list, regardless of whether or not
the vcpu was the idle vcpu. Since the idle vcpu's list field
was never initialized, a NULL pointer was passed to list_del.
When using cpupools, this resulted in a crash when moving a cpu
from an arinc653 scheduler pool.
Signed-off-by: Nathan Studer <nate.studer@dornerworks.com>
---
xen/common/sched_arinc653.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
index a1d9443..8a5bd9c 100644
--- a/xen/common/sched_arinc653.c
+++ b/xen/common/sched_arinc653.c
@@ -418,7 +418,9 @@ a653sched_free_vdata(const struct scheduler *ops, void *priv)
if (av == NULL)
return;
- list_del(&av->list);
+ if ( !is_idle_vcpu(av->vc) )
+ list_del(&av->list);
+
xfree(av);
update_schedule_vcpus(ops);
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] Fix sched_priv corruption in ARINC653 alloc_vdata.
2013-10-31 20:47 ` [PATCH 1/2] Fix sched_priv corruption in ARINC653 alloc_vdata Nathan Studer
@ 2013-11-01 13:53 ` Andrew Cooper
2013-11-03 23:07 ` Nate Studer
2013-11-04 15:49 ` George Dunlap
1 sibling, 1 reply; 13+ messages in thread
From: Andrew Cooper @ 2013-11-01 13:53 UTC (permalink / raw)
To: Nathan Studer; +Cc: george.dunlap, smartin, robert.vanvossen, xen-devel
On 31/10/13 20:47, Nathan Studer wrote:
> From: Nathan Studer <nate.studer@dornerworks.com>
>
> The ARINC653 scheduler was directly assigning and manipulating
> the sched_priv field of a vcpu in its alloc_vdata function.
>
> When creating a cpu pool, this resulted in the corruption
> of the sched_priv field of the vcpu, which was then passed
> to the initial scheduler's free_vdata function with
> disastrous results.
>
> Signed-off-by: Nathan Studer <nate.studer@dornerworks.com>
This looks sane.
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
You have one line of misc whitespace change. Given the extent of
trailing whitespace in the file, it might be worth having a separate
patch in the series which fixes all the whitespace at once. Along with
that, it would be kind to put a "Local variables" block in as well (see
the bottom of sched.h as an example).
> ---
> xen/common/sched_arinc653.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
> index 2502192..a1d9443 100644
> --- a/xen/common/sched_arinc653.c
> +++ b/xen/common/sched_arinc653.c
> @@ -380,11 +380,14 @@ a653sched_deinit(const struct scheduler *ops)
> static void *
> a653sched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
> {
> + arinc653_vcpu_t *svc;
> +
> /*
> * Allocate memory for the ARINC 653-specific scheduler data information
> * associated with the given VCPU (vc).
> - */
> - if ( (vc->sched_priv = xmalloc(arinc653_vcpu_t)) == NULL )
> + */
> + svc = xmalloc(arinc653_vcpu_t);
> + if ( svc == NULL )
> return NULL;
>
> /*
> @@ -393,13 +396,13 @@ a653sched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
> * will call the vcpu_wake scheduler callback function and our scheduler
> * will mark the VCPU awake.
> */
> - AVCPU(vc)->vc = vc;
> - AVCPU(vc)->awake = 0;
> + svc->vc = vc;
> + svc->awake = 0;
> if ( !is_idle_vcpu(vc) )
> - list_add(&AVCPU(vc)->list, &SCHED_PRIV(ops)->vcpu_list);
> + list_add(&svc->list, &SCHED_PRIV(ops)->vcpu_list);
> update_schedule_vcpus(ops);
>
> - return AVCPU(vc);
> + return svc;
> }
>
> /**
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] Fix NULL pointer dereference in ARINC653 free_vdata.
2013-10-31 20:47 ` [PATCH 2/2] Fix NULL pointer dereference in ARINC653 free_vdata Nathan Studer
@ 2013-11-01 13:56 ` Andrew Cooper
2013-11-01 14:13 ` George Dunlap
0 siblings, 1 reply; 13+ messages in thread
From: Andrew Cooper @ 2013-11-01 13:56 UTC (permalink / raw)
To: Nathan Studer; +Cc: george.dunlap, smartin, robert.vanvossen, xen-devel
On 31/10/13 20:47, Nathan Studer wrote:
> From: Nathan Studer <nate.studer@dornerworks.com>
>
> The ARINC653 scheduler alloc_vdata function does not add the
> idle cpu to its internal vcpu_list, but when the free_vdata
> function is called, the scheduler attempted to remove the vcpu
> from its internal vcpu_list, regardless of whether or not
> the vcpu was the idle vcpu. Since the idle vcpu's list field
> was never initialized, a NULL pointer was passed to list_del.
>
> When using cpupools, this resulted in a crash when moving a cpu
> from an arinc653 scheduler pool.
>
> Signed-off-by: Nathan Studer <nate.studer@dornerworks.com>
This again looks sane, but can't it logically be merged with the
previous patch? Both of the patches are "dont break on
{alloc,free}_vdata when using cpupools"
I guess this is a matter of taste.
~Andrew
> ---
> xen/common/sched_arinc653.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
> index a1d9443..8a5bd9c 100644
> --- a/xen/common/sched_arinc653.c
> +++ b/xen/common/sched_arinc653.c
> @@ -418,7 +418,9 @@ a653sched_free_vdata(const struct scheduler *ops, void *priv)
> if (av == NULL)
> return;
>
> - list_del(&av->list);
> + if ( !is_idle_vcpu(av->vc) )
> + list_del(&av->list);
> +
> xfree(av);
> update_schedule_vcpus(ops);
> }
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] Fix NULL pointer dereference in ARINC653 free_vdata.
2013-11-01 13:56 ` Andrew Cooper
@ 2013-11-01 14:13 ` George Dunlap
2013-11-01 14:17 ` Andrew Cooper
2013-11-03 23:01 ` Nate Studer
0 siblings, 2 replies; 13+ messages in thread
From: George Dunlap @ 2013-11-01 14:13 UTC (permalink / raw)
To: Andrew Cooper, Nathan Studer; +Cc: smartin, robert.vanvossen, xen-devel
On 01/11/13 13:56, Andrew Cooper wrote:
> On 31/10/13 20:47, Nathan Studer wrote:
>> From: Nathan Studer <nate.studer@dornerworks.com>
>>
>> The ARINC653 scheduler alloc_vdata function does not add the
>> idle cpu to its internal vcpu_list, but when the free_vdata
>> function is called, the scheduler attempted to remove the vcpu
>> from its internal vcpu_list, regardless of whether or not
>> the vcpu was the idle vcpu. Since the idle vcpu's list field
>> was never initialized, a NULL pointer was passed to list_del.
>>
>> When using cpupools, this resulted in a crash when moving a cpu
>> from an arinc653 scheduler pool.
>>
>> Signed-off-by: Nathan Studer <nate.studer@dornerworks.com>
> This again looks sane, but can't it logically be merged with the
> previous patch? Both of the patches are "dont break on
> {alloc,free}_vdata when using cpupools"
>
> I guess this is a matter of taste.
I don't think it's worth asking for a whole re-spin just to merge two
relatively short commits that *could* be merged but also work separately.
Both these patches can have my Ack, BTW (although I don't think they
need it): I just wanted to be a good citizen and do a bit of review. :-)
-George
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] Fix NULL pointer dereference in ARINC653 free_vdata.
2013-11-01 14:13 ` George Dunlap
@ 2013-11-01 14:17 ` Andrew Cooper
2013-11-03 23:01 ` Nate Studer
1 sibling, 0 replies; 13+ messages in thread
From: Andrew Cooper @ 2013-11-01 14:17 UTC (permalink / raw)
To: George Dunlap; +Cc: smartin, Nathan Studer, robert.vanvossen, xen-devel
On 01/11/13 14:13, George Dunlap wrote:
> On 01/11/13 13:56, Andrew Cooper wrote:
>> On 31/10/13 20:47, Nathan Studer wrote:
>>> From: Nathan Studer <nate.studer@dornerworks.com>
>>>
>>> The ARINC653 scheduler alloc_vdata function does not add the
>>> idle cpu to its internal vcpu_list, but when the free_vdata
>>> function is called, the scheduler attempted to remove the vcpu
>>> from its internal vcpu_list, regardless of whether or not
>>> the vcpu was the idle vcpu. Since the idle vcpu's list field
>>> was never initialized, a NULL pointer was passed to list_del.
>>>
>>> When using cpupools, this resulted in a crash when moving a cpu
>>> from an arinc653 scheduler pool.
>>>
>>> Signed-off-by: Nathan Studer <nate.studer@dornerworks.com>
>> This again looks sane, but can't it logically be merged with the
>> previous patch? Both of the patches are "dont break on
>> {alloc,free}_vdata when using cpupools"
>>
>> I guess this is a matter of taste.
>
> I don't think it's worth asking for a whole re-spin just to merge two
> relatively short commits that *could* be merged but also work separately.
>
> Both these patches can have my Ack, BTW (although I don't think they
> need it): I just wanted to be a good citizen and do a bit of review. :-)
>
> -George
>
Fair point - the fixes are far more critical than the problems I
nitpicked at.
FWIW, Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] Fix NULL pointer dereference in ARINC653 free_vdata.
2013-11-01 14:13 ` George Dunlap
2013-11-01 14:17 ` Andrew Cooper
@ 2013-11-03 23:01 ` Nate Studer
2013-11-04 10:46 ` George Dunlap
1 sibling, 1 reply; 13+ messages in thread
From: Nate Studer @ 2013-11-03 23:01 UTC (permalink / raw)
To: George Dunlap, Andrew Cooper; +Cc: robert.vanvossen, xen-devel
On 11/1/2013 10:13 AM, George Dunlap wrote:
> Both these patches can have my Ack, BTW (although I don't think they
> need it): I just wanted to be a good citizen and do a bit of review. :-)
Thanks Andrew and George.
Just to make sure, and to avoid needlessly filling George's inbox, Robbie (The
other ARINC653 scheduler maintainer) should usually be the one acking patches
like this, correct?
>
> -George
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] Fix sched_priv corruption in ARINC653 alloc_vdata.
2013-11-01 13:53 ` Andrew Cooper
@ 2013-11-03 23:07 ` Nate Studer
0 siblings, 0 replies; 13+ messages in thread
From: Nate Studer @ 2013-11-03 23:07 UTC (permalink / raw)
To: Andrew Cooper; +Cc: george.dunlap, smartin, robert.vanvossen, xen-devel
On 11/1/2013 9:53 AM, Andrew Cooper wrote:
> On 31/10/13 20:47, Nathan Studer wrote:
>> From: Nathan Studer <nate.studer@dornerworks.com>
>>
>> The ARINC653 scheduler was directly assigning and manipulating
>> the sched_priv field of a vcpu in its alloc_vdata function.
>>
>> When creating a cpu pool, this resulted in the corruption
>> of the sched_priv field of the vcpu, which was then passed
>> to the initial scheduler's free_vdata function with
>> disastrous results.
>>
>> Signed-off-by: Nathan Studer <nate.studer@dornerworks.com>
>
> This looks sane.
>
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
>
> You have one line of misc whitespace change. Given the extent of
> trailing whitespace in the file, it might be worth having a separate
> patch in the series which fixes all the whitespace at once. Along with
> that, it would be kind to put a "Local variables" block in as well (see
> the bottom of sched.h as an example).
These patches just fix the immediate problem of the hypervisor crashing when
using the arinc653 scheduler in cpu pools. I expect some more patches in the
near future to get pools fully working with the arinc653 scheduler, and since I
agree with your assessment, I can address this then.
Thanks for suggesting it.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] Fix NULL pointer dereference in ARINC653 free_vdata.
2013-11-03 23:01 ` Nate Studer
@ 2013-11-04 10:46 ` George Dunlap
2013-11-04 10:55 ` Ian Campbell
2013-11-04 15:15 ` Jan Beulich
0 siblings, 2 replies; 13+ messages in thread
From: George Dunlap @ 2013-11-04 10:46 UTC (permalink / raw)
To: Nate Studer, Andrew Cooper; +Cc: robert.vanvossen, xen-devel
On 03/11/13 23:01, Nate Studer wrote:
> On 11/1/2013 10:13 AM, George Dunlap wrote:
>> Both these patches can have my Ack, BTW (although I don't think they
>> need it): I just wanted to be a good citizen and do a bit of review. :-)
> Thanks Andrew and George.
>
> Just to make sure, and to avoid needlessly filling George's inbox, Robbie (The
> other ARINC653 scheduler maintainer) should usually be the one acking patches
> like this, correct?
Oh, don't worry about filling up my inbox. I do want to know what's
going on in the scheduling area, and I probably *should* review this
kind of patch anyway. I was just saying, I don't think the committers
necessarily need to wait for an Ack from me to commit it. :-)
I'm not sure exactly what the policy would be here -- I think the "need
an ack from someone else" rule is primarily for committers to commit
their own patches. If you're just submitting it, as a maintainer, it
seems like having the committer look over it (and being satisfied that
the community has had a chance to comment) should be enough, and needing
an extra Ack from the other committer is a bit over-kill, particularly
in this case.
But I could be wrong about that. :-)
-George
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] Fix NULL pointer dereference in ARINC653 free_vdata.
2013-11-04 10:46 ` George Dunlap
@ 2013-11-04 10:55 ` Ian Campbell
2013-11-04 15:15 ` Jan Beulich
1 sibling, 0 replies; 13+ messages in thread
From: Ian Campbell @ 2013-11-04 10:55 UTC (permalink / raw)
To: George Dunlap; +Cc: Andrew Cooper, Nate Studer, robert.vanvossen, xen-devel
On Mon, 2013-11-04 at 10:46 +0000, George Dunlap wrote:
> On 03/11/13 23:01, Nate Studer wrote:
> > On 11/1/2013 10:13 AM, George Dunlap wrote:
> >> Both these patches can have my Ack, BTW (although I don't think they
> >> need it): I just wanted to be a good citizen and do a bit of review. :-)
> > Thanks Andrew and George.
> >
> > Just to make sure, and to avoid needlessly filling George's inbox, Robbie (The
> > other ARINC653 scheduler maintainer) should usually be the one acking patches
> > like this, correct?
>
> Oh, don't worry about filling up my inbox. I do want to know what's
> going on in the scheduling area, and I probably *should* review this
> kind of patch anyway. I was just saying, I don't think the committers
> necessarily need to wait for an Ack from me to commit it. :-)
>
> I'm not sure exactly what the policy would be here -- I think the "need
> an ack from someone else" rule is primarily for committers to commit
> their own patches. If you're just submitting it, as a maintainer, it
> seems like having the committer look over it (and being satisfied that
> the community has had a chance to comment) should be enough, and needing
> an extra Ack from the other committer is a bit over-kill, particularly
> in this case.
If I were a committer in this area (which I'm not) this is the sort of
approach I would take...
>
> But I could be wrong about that. :-)
>
> -George
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 2/2] Fix NULL pointer dereference in ARINC653 free_vdata.
2013-11-04 10:46 ` George Dunlap
2013-11-04 10:55 ` Ian Campbell
@ 2013-11-04 15:15 ` Jan Beulich
1 sibling, 0 replies; 13+ messages in thread
From: Jan Beulich @ 2013-11-04 15:15 UTC (permalink / raw)
To: Nate Studer, George Dunlap; +Cc: Andrew Cooper, robert.vanvossen, xen-devel
>>> On 04.11.13 at 11:46, George Dunlap <george.dunlap@eu.citrix.com> wrote:
> On 03/11/13 23:01, Nate Studer wrote:
>> Just to make sure, and to avoid needlessly filling George's inbox, Robbie (The
>> other ARINC653 scheduler maintainer) should usually be the one acking patches
>> like this, correct?
>
> I'm not sure exactly what the policy would be here -- I think the "need
> an ack from someone else" rule is primarily for committers to commit
> their own patches. If you're just submitting it, as a maintainer, it
> seems like having the committer look over it (and being satisfied that
> the community has had a chance to comment) should be enough, and needing
> an extra Ack from the other committer is a bit over-kill, particularly
> in this case.
>
> But I could be wrong about that. :-)
My understanding is the same.
Jan
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 1/2] Fix sched_priv corruption in ARINC653 alloc_vdata.
2013-10-31 20:47 ` [PATCH 1/2] Fix sched_priv corruption in ARINC653 alloc_vdata Nathan Studer
2013-11-01 13:53 ` Andrew Cooper
@ 2013-11-04 15:49 ` George Dunlap
1 sibling, 0 replies; 13+ messages in thread
From: George Dunlap @ 2013-11-04 15:49 UTC (permalink / raw)
To: Nathan Studer, xen-devel; +Cc: smartin, robert.vanvossen
On 31/10/13 20:47, Nathan Studer wrote:
> From: Nathan Studer <nate.studer@dornerworks.com>
>
> The ARINC653 scheduler was directly assigning and manipulating
> the sched_priv field of a vcpu in its alloc_vdata function.
>
> When creating a cpu pool, this resulted in the corruption
> of the sched_priv field of the vcpu, which was then passed
> to the initial scheduler's free_vdata function with
> disastrous results.
>
> Signed-off-by: Nathan Studer <nate.studer@dornerworks.com>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
> ---
> xen/common/sched_arinc653.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
>
> diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c
> index 2502192..a1d9443 100644
> --- a/xen/common/sched_arinc653.c
> +++ b/xen/common/sched_arinc653.c
> @@ -380,11 +380,14 @@ a653sched_deinit(const struct scheduler *ops)
> static void *
> a653sched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
> {
> + arinc653_vcpu_t *svc;
> +
> /*
> * Allocate memory for the ARINC 653-specific scheduler data information
> * associated with the given VCPU (vc).
> - */
> - if ( (vc->sched_priv = xmalloc(arinc653_vcpu_t)) == NULL )
> + */
> + svc = xmalloc(arinc653_vcpu_t);
> + if ( svc == NULL )
> return NULL;
>
> /*
> @@ -393,13 +396,13 @@ a653sched_alloc_vdata(const struct scheduler *ops, struct vcpu *vc, void *dd)
> * will call the vcpu_wake scheduler callback function and our scheduler
> * will mark the VCPU awake.
> */
> - AVCPU(vc)->vc = vc;
> - AVCPU(vc)->awake = 0;
> + svc->vc = vc;
> + svc->awake = 0;
> if ( !is_idle_vcpu(vc) )
> - list_add(&AVCPU(vc)->list, &SCHED_PRIV(ops)->vcpu_list);
> + list_add(&svc->list, &SCHED_PRIV(ops)->vcpu_list);
> update_schedule_vcpus(ops);
>
> - return AVCPU(vc);
> + return svc;
> }
>
> /**
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2013-11-04 15:49 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-31 20:47 [PATCH 0/2] Fix crashes with arinc653 cpupools Nathan Studer
2013-10-31 20:47 ` [PATCH 1/2] Fix sched_priv corruption in ARINC653 alloc_vdata Nathan Studer
2013-11-01 13:53 ` Andrew Cooper
2013-11-03 23:07 ` Nate Studer
2013-11-04 15:49 ` George Dunlap
2013-10-31 20:47 ` [PATCH 2/2] Fix NULL pointer dereference in ARINC653 free_vdata Nathan Studer
2013-11-01 13:56 ` Andrew Cooper
2013-11-01 14:13 ` George Dunlap
2013-11-01 14:17 ` Andrew Cooper
2013-11-03 23:01 ` Nate Studer
2013-11-04 10:46 ` George Dunlap
2013-11-04 10:55 ` Ian Campbell
2013-11-04 15:15 ` Jan Beulich
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).