• Hugh Dickins's avatar
    kaiser: x86_cr3_pcid_noflush and x86_cr3_pcid_user · 4f7e1682
    Hugh Dickins authored
    Mostly this commit is just unshouting X86_CR3_PCID_KERN_VAR and
    X86_CR3_PCID_USER_VAR: we usually name variables in lower-case.
    
    But why does x86_cr3_pcid_noflush need to be __aligned(PAGE_SIZE)?
    Ah, it's a leftover from when kaiser_add_user_map() once complained
    about mapping the same page twice.  Make it __read_mostly instead.
    (I'm a little uneasy about all the unrelated data which shares its
    page getting user-mapped too, but that was so before, and not a big
    deal: though we call it user-mapped, it's not mapped with _PAGE_USER.)
    
    And there is a little change around the two calls to do_nmi().
    Previously they set the NOFLUSH bit (if PCID supported) when
    forcing to kernel context before do_nmi(); now they also have the
    NOFLUSH bit set (if PCID supported) when restoring context after:
    nothing done in do_nmi() should require a TLB to be flushed here.
    Acked-by: default avatarJiri Kosina <jkosina@suse.cz>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    
    CVE-2017-5754
    Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
    Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
    4f7e1682
kaiser.c 11.1 KB