|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [RFC PATCH 3/7] xeniface: Enforce read-only foreign page views
On 10/11/2026 19:36, Rafał Wojdyła wrote:
> From: Rafał Wojdyła <omeg@xxxxxxx>
>
> Pass MdlMappingNoWrite when exposing read-only foreign pages to user
> mode. Reject notify byte configuration for these mappings because cleanup
> must not write through a read-only foreign mapping.
>
> Assisted-by: LLM
> Signed-off-by: Rafał Wojdyła <omeg@xxxxxxxxxxxxxxxxxxxxxx>
Reviewed-by: Tu Dinh <ngoc-tu.dinh@xxxxxxxxxx>
> ---
> src/xeniface/ioctl_gnttab.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/xeniface/ioctl_gnttab.c b/src/xeniface/ioctl_gnttab.c
> index c6d82bc..12b1c0a 100644
> --- a/src/xeniface/ioctl_gnttab.c
> +++ b/src/xeniface/ioctl_gnttab.c
> @@ -717,7 +717,8 @@ IoctlGnttabMapForeignPages(
> }
>
> if ((In->Flags & XENIFACE_GNTTAB_USE_NOTIFY_OFFSET) &&
> - (In->NotifyOffset >= In->NumberPages * PAGE_SIZE)) {
> + (In->NotifyOffset >= In->NumberPages * PAGE_SIZE ||
> + (In->Flags & XENIFACE_GNTTAB_READONLY))) {
> goto fail7;
> }
>
> @@ -771,7 +772,8 @@ IoctlGnttabMapForeignPages(
> MmCached,
> NULL,
> FALSE,
> - NormalPagePriority);
> + NormalPagePriority |
> + ((Context->Flags &
> XENIFACE_GNTTAB_READONLY) ? MdlMappingNoWrite : 0));
> } except (EXCEPTION_EXECUTE_HANDLER) {
> status = GetExceptionCode();
> goto fail12;
--
Ngoc Tu Dinh | Vates XCP-ng Developer
XCP-ng & Xen Orchestra - Vates solutions
web: https://vates.tech
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |