what has been currently allocated to the domain causing the kernel to
crash. This patch validates the value passed in and prevents setting the
value below the current allocation level.
Signed-off-by: ksrinivasan@novell.com
d = find_domain_by_id(op->u.setdomainmaxmem.domain);
if ( d != NULL )
{
- d->max_pages = op->u.setdomainmaxmem.max_memkb >> (PAGE_SHIFT-10);
+ unsigned long new_max;
+ new_max = op->u.setdomainmaxmem.max_memkb >> (PAGE_SHIFT-10);
+ if (new_max < d->tot_pages)
+ ret = -EINVAL;
+ else
+ {
+ d->max_pages = new_max;
+ ret = 0;
+ }
put_domain(d);
- ret = 0;
}
}
break;