|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen master] gnttab: complete checking in gnttab_copy_buf_valid()
commit 266df0688c8a4fc243cd2bfd1f4cb09164f99bff
Author: Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Nov 3 12:03:18 2026 +0000
Commit: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Tue Nov 3 12:03:21 2026 +0000
gnttab: complete checking in gnttab_copy_buf_valid()
The ->have_grant field needs checking not only ahead of comparing GREFs,
but also ahead of comparing MFNs. Else a (likely invalid) GREF from an
earlier batch element can be mistaken for a (possibly valid) MFN.
This is CVE-2026-102703, part of XSA-523.
Fixes: d28f42f2703e ("grant-table: defer releasing pages acquired in a
grant copy")
Assisted-by: Claude
Reported-by: Stephan Lipp <Stephan@xxxxxxxxxxxxx>
Reported-by: CodeAnt AI Security Research <securityresearch@xxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
xen/common/grant_table.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index b15805f3f9..3dc5ff88da 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -3083,10 +3083,10 @@ static bool gnttab_copy_buf_valid(
const struct gnttab_copy_ptr *p, const struct gnttab_copy_buf *b,
bool has_gref)
{
- if ( !b->virt )
+ if ( !b->virt || b->have_grant != has_gref )
return 0;
if ( has_gref )
- return b->have_grant && p->u.ref == b->ptr.u.ref;
+ return p->u.ref == b->ptr.u.ref;
return p->u.gmfn == b->ptr.u.gmfn;
}
--
generated by git-patchbot for /home/xen/git/xen.git#master
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |