diff options
author | Jan Beulich <jbeulich@suse.com> | 2013-04-05 10:02:05 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-04-05 10:02:05 +0200 |
commit | 2bebeac00164b8fd6fdc98db74df943d927aab06 (patch) | |
tree | 12852b041c0a4975063bafb63cf4caae16c7314b | |
parent | 70b67e907427c3c891d8b6b1ba656b2136e34418 (diff) | |
download | xen-2bebeac00164b8fd6fdc98db74df943d927aab06.tar.gz xen-2bebeac00164b8fd6fdc98db74df943d927aab06.tar.bz2 xen-2bebeac00164b8fd6fdc98db74df943d927aab06.zip |
defer event channel bucket pointer store until after XSM checks
Otherwise a dangling pointer can be left, which would cause subsequent
memory corruption as soon as the space got re-allocated for some other
purpose.
This is CVE-2013-1920 / XSA-47.
Reported-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
master commit: 99b9ab0b3e7f0e7e5786116773cb7b746f3fab87
master date: 2013-04-05 09:59:03 +0200
-rw-r--r-- | xen/common/event_channel.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c index 53777f8888..46219bd1b0 100644 --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -140,7 +140,6 @@ static int get_free_port(struct domain *d) chn = xzalloc_array(struct evtchn, EVTCHNS_PER_BUCKET); if ( unlikely(chn == NULL) ) return -ENOMEM; - bucket_from_port(d, port) = chn; for ( i = 0; i < EVTCHNS_PER_BUCKET; i++ ) { @@ -153,6 +152,8 @@ static int get_free_port(struct domain *d) } } + bucket_from_port(d, port) = chn; + return port; } |