gnttab: drop bogus check from _cache_flush()
PATCH 1/1 gnttab: drop bogus check from _cache_flush()
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).
xen/common/grant_table.c +1 -1
@@ -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 ;
Quoted 13 lines · Jan Beulich
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 <[email protected]>Reported-by Yehyeong Lee <[email protected]>Signed-off-by Jan Beulich <[email protected]>
xen/common/grant_table.c static int _cache_flush(gnttab_cache_flu · line 3643
Quoted 8 lines
xen/common/grant_table.c +1
-1@@ -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
Quoted 15 lines · Andrew Cooper
Quoted 14 lines · Jan Beulich
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 <[email protected]>Reported-by Yehyeong Lee <[email protected]>Signed-off-by Jan Beulich <[email protected]>xen/common/grant_table.c +0
-0@@ -3637,7 +3637,7 @@ static int _cache_flush(gnttab_cache_flu
Quoted 10 lines
xen/common/grant_table.c static int _cache_flush(gnttab_cache_flu · line 3643
Quoted 7 lines
xen/common/grant_table.c +1
-1page =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.
Quoted 3 lines
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
Quoted 27 lines · Jan Beulich
Quoted 15 lines · Andrew Cooper
Quoted 14 lines · Jan Beulich
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 <[email protected]>Reported-by Yehyeong Lee <[email protected]>Signed-off-by Jan Beulich <[email protected]>xen/common/grant_table.c +0
-0@@ -3637,7 +3637,7 @@ static int _cache_flush(gnttab_cache_fluQuoted 10 lines
xen/common/grant_table.c static int _cache_flush(gnttab_cache_flu · line 3643
Quoted 7 lines
xen/common/grant_table.c +1
-1page =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?
Quoted 8 lines
I do. That was after I had made this patch, though.
Quoted 3 lines
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