Re: [PATCH] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-15 Thread Greg Hackmann
On 08/14/2018 08:29 AM, Will Deacon wrote: > On Tue, Aug 14, 2018 at 08:17:48AM -0700, Greg Hackmann wrote: >> On 08/14/2018 03:40 AM, Will Deacon wrote: >>> Hi Greg, >>> >>> On Mon, Aug 13, 2018 at 12:30:11PM -0700, Greg Hackmann wrote: ARM64's pfn_valid() shifts away the upper PAGE_SHIFT

Re: [PATCH] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-15 Thread Greg Hackmann
On 08/14/2018 08:29 AM, Will Deacon wrote: > On Tue, Aug 14, 2018 at 08:17:48AM -0700, Greg Hackmann wrote: >> On 08/14/2018 03:40 AM, Will Deacon wrote: >>> Hi Greg, >>> >>> On Mon, Aug 13, 2018 at 12:30:11PM -0700, Greg Hackmann wrote: ARM64's pfn_valid() shifts away the upper PAGE_SHIFT

Re: [PATCH] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-14 Thread Will Deacon
On Tue, Aug 14, 2018 at 08:17:48AM -0700, Greg Hackmann wrote: > On 08/14/2018 03:40 AM, Will Deacon wrote: > > Hi Greg, > > > > On Mon, Aug 13, 2018 at 12:30:11PM -0700, Greg Hackmann wrote: > >> ARM64's pfn_valid() shifts away the upper PAGE_SHIFT bits of the input > >> before seeing if the PFN

Re: [PATCH] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-14 Thread Will Deacon
On Tue, Aug 14, 2018 at 08:17:48AM -0700, Greg Hackmann wrote: > On 08/14/2018 03:40 AM, Will Deacon wrote: > > Hi Greg, > > > > On Mon, Aug 13, 2018 at 12:30:11PM -0700, Greg Hackmann wrote: > >> ARM64's pfn_valid() shifts away the upper PAGE_SHIFT bits of the input > >> before seeing if the PFN

Re: [PATCH] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-14 Thread Greg Hackmann
On 08/14/2018 03:40 AM, Will Deacon wrote: > Hi Greg, > > On Mon, Aug 13, 2018 at 12:30:11PM -0700, Greg Hackmann wrote: >> ARM64's pfn_valid() shifts away the upper PAGE_SHIFT bits of the input >> before seeing if the PFN is valid. This leads to false positives when >> some of the upper bits

Re: [PATCH] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-14 Thread Greg Hackmann
On 08/14/2018 03:40 AM, Will Deacon wrote: > Hi Greg, > > On Mon, Aug 13, 2018 at 12:30:11PM -0700, Greg Hackmann wrote: >> ARM64's pfn_valid() shifts away the upper PAGE_SHIFT bits of the input >> before seeing if the PFN is valid. This leads to false positives when >> some of the upper bits

Re: [PATCH] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-14 Thread Will Deacon
Hi Greg, On Mon, Aug 13, 2018 at 12:30:11PM -0700, Greg Hackmann wrote: > ARM64's pfn_valid() shifts away the upper PAGE_SHIFT bits of the input > before seeing if the PFN is valid. This leads to false positives when > some of the upper bits are set, but the lower bits match a valid PFN. > >

Re: [PATCH] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-14 Thread Will Deacon
Hi Greg, On Mon, Aug 13, 2018 at 12:30:11PM -0700, Greg Hackmann wrote: > ARM64's pfn_valid() shifts away the upper PAGE_SHIFT bits of the input > before seeing if the PFN is valid. This leads to false positives when > some of the upper bits are set, but the lower bits match a valid PFN. > >

[PATCH] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-13 Thread Greg Hackmann
ARM64's pfn_valid() shifts away the upper PAGE_SHIFT bits of the input before seeing if the PFN is valid. This leads to false positives when some of the upper bits are set, but the lower bits match a valid PFN. For example, the following userspace code looks up a bogus entry in /proc/kpageflags:

[PATCH] arm64: mm: check for upper PAGE_SHIFT bits in pfn_valid()

2018-08-13 Thread Greg Hackmann
ARM64's pfn_valid() shifts away the upper PAGE_SHIFT bits of the input before seeing if the PFN is valid. This leads to false positives when some of the upper bits are set, but the lower bits match a valid PFN. For example, the following userspace code looks up a bogus entry in /proc/kpageflags: