lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 15 Jun 2022 11:32:40 +0200
From:   Juergen Gross <jgross@...e.com>
To:     Viresh Kumar <viresh.kumar@...aro.org>
Cc:     xen-devel@...ts.xenproject.org, linux-doc@...r.kernel.org,
        linux-kernel@...r.kernel.org, Jonathan Corbet <corbet@....net>,
        Stefano Stabellini <sstabellini@...nel.org>,
        Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>
Subject: Re: [PATCH] xen: don't require virtio with grants for non-PV guests

On 15.06.22 11:25, Viresh Kumar wrote:
> On 15-06-22, 10:48, Juergen Gross wrote:
>> Commit fa1f57421e0b ("xen/virtio: Enable restricted memory access using
>> Xen grant mappings") introduced a new requirement for using virtio
>> devices: the backend now needs to support the VIRTIO_F_ACCESS_PLATFORM
>> feature.
>>
>> This is an undue requirement for non-PV guests, as those can be operated
>> with existing backends without any problem, as long as those backends
>> are running in dom0.
>>
>> Per default allow virtio devices without grant support for non-PV
>> guests.
>>
>> The setting can be overridden by using the new "xen_virtio_grant"
>> command line parameter.
>>
>> Add a new config item to always force use of grants for virtio.
>>
>> Fixes: fa1f57421e0b ("xen/virtio: Enable restricted memory access using Xen grant mappings")
>> Signed-off-by: Juergen Gross <jgross@...e.com>
>> ---
>>   .../admin-guide/kernel-parameters.txt         |  6 +++++
>>   drivers/xen/Kconfig                           |  9 ++++++++
>>   drivers/xen/grant-dma-ops.c                   | 22 +++++++++++++++++++
>>   include/xen/xen.h                             | 12 +++++-----
>>   4 files changed, 42 insertions(+), 7 deletions(-)
> 
> Thanks for the quick fix.
> 
> With CONFIG_DEBUG_SECTION_MISMATCH=y, this generates a warning.
> 
> WARNING: modpost: vmlinux.o(.text+0x7a8270): Section mismatch in reference from the function xen_set_restricted_virtio_memory_access() to the variable .init.data:xen_virtio_grants
> The function xen_set_restricted_virtio_memory_access() references
> the variable __initdata xen_virtio_grants.
> This is often because xen_set_restricted_virtio_memory_access lacks a __initdata
> annotation or the annotation of xen_virtio_grants is wrong.

Silly me. Thanks for the notice.

> 
> This can be fixed by:
> 
> diff --git a/drivers/xen/grant-dma-ops.c b/drivers/xen/grant-dma-ops.c
> index d1fae789dfad..1099097b4515 100644
> --- a/drivers/xen/grant-dma-ops.c
> +++ b/drivers/xen/grant-dma-ops.c
> @@ -42,7 +42,7 @@ static __init int parse_use_grants(char *arg)
>   }
>   early_param("xen_virtio_grant", parse_use_grants);
> 
> -void xen_set_restricted_virtio_memory_access(void)
> +void __init xen_set_restricted_virtio_memory_access(void)
>   {
>          if (IS_ENABLED(CONFIG_XEN_VIRTIO_FORCE_GRANT) || xen_virtio_grants ||
>              (!xen_virtio_grants_set && xen_pv_domain()))
> 
> With that:
> 
> Tested-by: Viresh Kumar <viresh.kumar@...aro.org>
> 

Thanks,


Juergen

Download attachment "OpenPGP_0xB0DE9DD628BF132F.asc" of type "application/pgp-keys" (3099 bytes)

Download attachment "OpenPGP_signature" of type "application/pgp-signature" (496 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ