• Hugh Dickins's avatar
    kaiser: kaiser_remove_mapping() move along the pgd · 2023a842
    Hugh Dickins authored
    When removing the bogus comment from kaiser_remove_mapping(),
    I really ought to have checked the extent of its bogosity: as
    Neel points out, there is nothing to stop unmap_pud_range_nofree()
    from continuing beyond the end of a pud (and starting in the wrong
    position on the next).
    
    Fix kaiser_remove_mapping() to constrain the extent and advance pgd
    pointer correctly: use pgd_addr_end() macro as used throughout base
    mm (but don't assume page-rounded start and size in this case).
    
    But this bug was very unlikely to trigger in this backport: since
    any buddy allocation is contained within a single pud extent, and
    we are not using vmapped stacks (and are only mapping one page of
    stack anyway): the only way to hit this bug here would be when
    freeing a large modified ldt.
    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>
    2023a842
kaiser.c 9.5 KB