From: Juergen Gross <jgr...@suse.com>

commit 72103f08cde854334ec48d30f33d58a642d68344 from
https://github.com/altera-opensource/linux-socfpga.git

[upstream commit 6b1775f26a2da2b05a6dc8ec2b5d14e9a4701a1a]

Add a new grant table function gnttab_try_end_foreign_access(), which
will remove and free a grant if it is not in use.

Its main use case is to either free a grant if it is no longer in use,
or to take some other action if it is still in use. This other action
can be an error exit, or (e.g. in the case of blkfront persistent grant
feature) some special handling.

This is CVE-2022-23036, CVE-2022-23038 / part of XSA-396.

Reported-by: Demi Marie Obenour <d...@invisiblethingslab.com>
Signed-off-by: Juergen Gross <jgr...@suse.com>
Reviewed-by: Jan Beulich <jbeul...@suse.com>
Signed-off-by: Wenlin Kang <wenlin.k...@windriver.com>
---
 include/xen/grant_table.h | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h
index 57b4ae6a4a18..ddaa586ba418 100644
--- a/include/xen/grant_table.h
+++ b/include/xen/grant_table.h
@@ -100,12 +100,7 @@ int gnttab_end_foreign_access_ref(grant_ref_t ref, int 
readonly);
  * Note that the granted page might still be accessed (read or write) by the
  * other side after gnttab_end_foreign_access() returns, so even if page was
  * specified as 0 it is not allowed to just reuse the page for other
- * purposes immediately. gnttab_end_foreign_access() will take an additional
- * reference to the granted page in this case, which is dropped only after
- * the grant is no longer in use.
- * This requires that multi page allocations for areas subject to
- * gnttab_end_foreign_access() are done via alloc_pages_exact() (and freeing
- * via free_pages_exact()) in order to avoid high order pages.
+ * purposes immediately.
  */
 void gnttab_end_foreign_access(grant_ref_t ref, int readonly,
                               unsigned long page);
-- 
2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#12582): 
https://lists.yoctoproject.org/g/linux-yocto/message/12582
Mute This Topic: https://lists.yoctoproject.org/mt/98921503/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to