There's no such thing as an alive domain without ->grant_table, and system
domains (on Arm) don't own any pages. The check should also not be left
there "just in case", because if that check could legitimately yield
"false", the page reference obtained would then need dropping on the
subsequent error path (see XSA-520).
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reported-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3637,7 +3637,7 @@ static int _cache_flush(gnttab_cache_flu
page = mfn_to_page(mfn);
owner = page_get_owner_and_reference(page);
- if ( !owner || !owner->grant_table )
+ if ( !owner )
{
rcu_unlock_domain(d);
return -EPERM;
On 14/10/2026 1:52 pm, Jan Beulich wrote:
> There's no such thing as an alive domain without ->grant_table, and system
> domains (on Arm) don't own any pages. The check should also not be left
> there "just in case", because if that check could legitimately yield
> "false", the page reference obtained would then need dropping on the
> subsequent error path (see XSA-520).
>
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reported-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/common/grant_table.c
> +++ b/xen/common/grant_table.c
> @@ -3637,7 +3637,7 @@ static int _cache_flush(gnttab_cache_flu
>
> page = mfn_to_page(mfn);
> owner = page_get_owner_and_reference(page);
> - if ( !owner || !owner->grant_table )
> + if ( !owner )
> {
> rcu_unlock_domain(d);
> return -EPERM;
Do you remember that I already posted this patch (to the security team),
and you already reviewed it?
I'm afraid that your commit message is hard to follow, despite knowing
the details. I already have one prepared from 3 weeks ago which I think
is rather clearer to follow.
~Andrew
On 14.10.2026 18:24, Andrew Cooper wrote:
> On 14/10/2026 1:52 pm, Jan Beulich wrote:
>> There's no such thing as an alive domain without ->grant_table, and system
>> domains (on Arm) don't own any pages. The check should also not be left
>> there "just in case", because if that check could legitimately yield
>> "false", the page reference obtained would then need dropping on the
>> subsequent error path (see XSA-520).
>>
>> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> Reported-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>
>> --- a/xen/common/grant_table.c
>> +++ b/xen/common/grant_table.c
>> @@ -3637,7 +3637,7 @@ static int _cache_flush(gnttab_cache_flu
>>
>> page = mfn_to_page(mfn);
>> owner = page_get_owner_and_reference(page);
>> - if ( !owner || !owner->grant_table )
>> + if ( !owner )
>> {
>> rcu_unlock_domain(d);
>> return -EPERM;
>
> Do you remember that I already posted this patch (to the security team),
> and you already reviewed it?
I do. That was after I had made this patch, though.
> I'm afraid that your commit message is hard to follow, despite knowing
> the details. I already have one prepared from 3 weeks ago which I think
> is rather clearer to follow.
I'm happy for you to post (and commit) yours. I just didn't want this to
fall between the cracks.
Jan
On 15.10.2026 09:11, Jan Beulich wrote:
> On 14.10.2026 18:24, Andrew Cooper wrote:
>> On 14/10/2026 1:52 pm, Jan Beulich wrote:
>>> There's no such thing as an alive domain without ->grant_table, and system
>>> domains (on Arm) don't own any pages. The check should also not be left
>>> there "just in case", because if that check could legitimately yield
>>> "false", the page reference obtained would then need dropping on the
>>> subsequent error path (see XSA-520).
>>>
>>> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>> Reported-by: Yehyeong Lee <yhlee@isslab.korea.ac.kr>
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>>
>>> --- a/xen/common/grant_table.c
>>> +++ b/xen/common/grant_table.c
>>> @@ -3637,7 +3637,7 @@ static int _cache_flush(gnttab_cache_flu
>>>
>>> page = mfn_to_page(mfn);
>>> owner = page_get_owner_and_reference(page);
>>> - if ( !owner || !owner->grant_table )
>>> + if ( !owner )
>>> {
>>> rcu_unlock_domain(d);
>>> return -EPERM;
>>
>> Do you remember that I already posted this patch (to the security team),
>> and you already reviewed it?
>
> I do. That was after I had made this patch, though.
>
>> I'm afraid that your commit message is hard to follow, despite knowing
>> the details. I already have one prepared from 3 weeks ago which I think
>> is rather clearer to follow.
>
> I'm happy for you to post (and commit) yours. I just didn't want this to
> fall between the cracks.
Are you going to post your patch then, for me to ack? Or are you willing to
ack mine? We should make progress here, whichever way.
Jan
© 2016 - 2026 Red Hat, Inc.