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:   Tue, 11 Jul 2023 16:31:46 +0200
From:   Claudio Imbrenda <imbrenda@...ux.ibm.com>
To:     Philippe Mathieu-Daudé <philmd@...aro.org>
Cc:     kvm@...r.kernel.org, linux-s390@...r.kernel.org,
        linux-kernel@...r.kernel.org, frankja@...ux.ibm.com,
        mhartmay@...ux.ibm.com, nsg@...ux.ibm.com, borntraeger@...ibm.com,
        nrb@...ux.ibm.com
Subject: Re: [PATCH v2 2/2] KVM: s390: pv: fix index value of replaced ASCE

On Tue, 11 Jul 2023 16:12:54 +0200
Philippe Mathieu-Daudé <philmd@...aro.org> wrote:

> On 5/7/23 13:19, Claudio Imbrenda wrote:
> > The index field of the struct page corresponding to a guest ASCE should
> > be 0. When replacing the ASCE in s390_replace_asce(), the index of the
> > new ASCE should also be set to 0.
> > 
> > Having the wrong index might lead to the wrong addresses being passed
> > around when notifying pte invalidations, and eventually to validity
> > intercepts (VM crash) if the prefix gets unmapped and the notifier gets
> > called with the wrong address.  
> 
> Can that also happen in crst_table_alloc()?

no. ->index is only used for gmap page tables (guest mapping), from
the root to pmd tables. the last level (ptes) is shared between guest
mapping and QEMU address space. i.e. the ptes are the ones from QEMU.

the last level of page tables is not expected to have ->index set
(since that one actually belongs to QEMU and not to the guest mapping)

guest page tables (all levels, except ptes) are allocated with
gmap_alloc_table(), which correctly sets ->index

the top level of a guest mapping is allocated in gmap_alloc(), which
also correctly sets ->index to 0.

> 
> > Signed-off-by: Claudio Imbrenda <imbrenda@...ux.ibm.com>
> > ---
> >   arch/s390/mm/gmap.c | 1 +
> >   1 file changed, 1 insertion(+)  
> 
> Reviewed-by: Philippe Mathieu-Daudé <philmd@...aro.org>

thank you!
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ