android_kernel_xiaomi_sm7250/net/9p
Juergen Gross 2466bed361 xen/9p: use alloc/free_pages_exact()
Commit 5cadd4bb1d7fc9ab201ac14620d1a478357e4ebd upstream.

Instead of __get_free_pages() and free_pages() use alloc_pages_exact()
and free_pages_exact(). This is in preparation of a change of
gnttab_end_foreign_access() which will prohibit use of high-order
pages.

By using the local variable "order" instead of ring->intf->ring_order
in the error path of xen_9pfs_front_alloc_dataring() another bug is
fixed, as the error path can be entered before ring->intf->ring_order
is being set.

By using alloc_pages_exact() the size in bytes is specified for the
allocation, which fixes another bug for the case of
order < (PAGE_SHIFT - XEN_PAGE_SHIFT).

This is part of CVE-2022-23041 / XSA-396.

Reported-by: Simon Gaiser <simon@invisiblethingslab.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-11 10:15:13 +01:00
..
client.c 9p/net: fix missing error check in p9_check_errors 2021-11-26 11:36:17 +01:00
error.c
Kconfig
Makefile
mod.c
protocol.c
protocol.h
trans_common.c
trans_common.h
trans_fd.c
trans_rdma.c
trans_virtio.c 9p/trans_virtio: Remove sysfs file on probe failure 2021-09-26 13:39:47 +02:00
trans_xen.c xen/9p: use alloc/free_pages_exact() 2022-03-11 10:15:13 +01:00
util.c