Whether a domain is allowed to issue cache-control operations is reported
by the cache_flush_permitted() check. Introduce such check to limit the
availability of GNTTABOP_cache_flush to only guests that are granted cache
control.
Fixes: 18e8d22fe750 ("introduce GNTTABOP_cache_flush")
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
if ( unlikely(!guest_handle_okay(cflush, count)) )
goto out;
+
+ rc = -EPERM;
+ if ( !cache_flush_permitted(current->domain) )
+ goto out;
+
rc = gnttab_cache_flush(cflush, &opaque_in, count);
if ( rc >= 0 )
{