mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen/rangeset: fix incorrect subtraction
Given the following rangset operation:
{ [0, 1], [4, 5] } - { [3, 4] }
The current rangeset logic will output a rangeset:
{ [0, 2], [5, 5] }
This is incorrect, and also has the undesirable property of being bogus in
a way that the resulting rangeset is expanded.
Fix this by making sure the bounds are correctly checked before modifying
the previous range.
Fixes: 484a058c48 ('Add auto-destructing per-domain rangeset data structure...')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
1 parent
a43b0a770b
commit
e118fc98e7
1 file changed
+2
-1
@@ -227,7 +227,8 @@ int rangeset_remove_range(
|
||||
|
||||
if ( x->s < s )
|
||||
{
|
||||
x->e = s - 1;
|
||||
if ( x->e >= s )
|
||||
x->e = s - 1;
|
||||
x = next_range(r, x);
|
||||
}
|
||||
|
||||
|
||||