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, 18 Jan 2022 11:04:00 -0800
From:   Yury Norov <yury.norov@...il.com>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Nicholas Piggin <npiggin@...il.com>,
        Ding Tianhong <dingtianhong@...wei.com>,
        Anshuman Khandual <anshuman.khandual@....com>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org
Subject: Re: [RFC PATCH] arm64: don't vmap() invalid page

On Tue, Jan 18, 2022 at 10:56 AM Matthew Wilcox <willy@...radead.org> wrote:
>
> On Tue, Jan 18, 2022 at 10:53:54AM -0800, Yury Norov wrote:
> > vmap() takes struct page *pages as one of arguments, and user may provide
> > an invalid pointer, which would lead to DABT at address translation later.
> > Currently, kernel checks the pages against NULL. In my case, however, the
> > address was not NULL, and was big enough so that the hardware generated
> > Address Size Abort.
> >
> > Interestingly, this abort happens even if copy_from_kernel_nofault() is used,
> > which is quite inconvenient for debugging purposes.
> >
> > This patch adds an arch_vmap_page_valid() helper into vmap() path, so that
> > architectures may add arch-specific checks of the pointer passed into vmap.
> >
> > For arm64, if the page passed to vmap() corresponds to a physical address
> > greater than maximum possible value as described in TCR_EL1.IPS register, the
> > following table walk would generate Address Size Abort. Instead of creating
> > the invalid mapping, kernel will return ERANGE in such situation.
>
> This seems like a very elaborate way of spelling:
>
>         pfn_valid(page_to_pfn(page));
>
> which doesn't require any architecture hook.  No?

Looks like yes. I'll resend later today if there are no other
comments. Thank you
for the hint.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ