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] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.11.1405160910220.17310@knanqh.ubzr>
Date:	Fri, 16 May 2014 09:16:53 -0400 (EDT)
From:	Nicolas Pitre <nicolas.pitre@...aro.org>
To:	Richard Lee <superlibj8301@...il.com>
cc:	Russell King - ARM Linux <linux@....linux.org.uk>,
	iamjoonsoo.kim@....com, santosh.shilimkar@...com,
	linux-arm-kernel@...ts.infradead.org,
	Arnd Bergmann <arnd@...db.de>, Li.Xiubo@...escale.com,
	robherring2@...il.com, linux-kernel@...r.kernel.org,
	lauraa@...eaurora.org
Subject: Re: [PATCHv2] ARM: ioremap: Fix static vm area boundary checking.

On Fri, 16 May 2014, Richard Lee wrote:

> On Fri, May 16, 2014 at 1:28 AM, Nicolas Pitre <nicolas.pitre@...aro.org> wrote:
> > On Thu, 15 May 2014, Richard Lee wrote:
> >
> >> Static vm area boundary check:
> >>
> >>       paddr1 --->|       |
> >>                  |       |
> >>                  |-------| <-\--- svm->vm->addr(is page aligned)
> >>       paddr2 --->|       |    |
> >>                  |     --| <--|-- svm->vm->phys_addr
> >>                  |       |    |
> >>       paddr3 --->|       |    |
> >>                  |       |    |
> >>                  |-------| <--|-- next page boundary
> >>                  |       |    |
> >>       paddr4 --->|       |    | <----- svm->vm->size(including guard page)
> >>                  |       |    |
> >>                  |       |    |
> >> max paddr_end -->|-------| <--|-- svm->vm's phys_addr_end
> >>                  | ///// |    |
> >>       paddr5 --->| guard |    |
> >>                  | page  |    |
> >>                  | ///// |    |
> >>                   -------  <-/--- svm->vm->addr + svm->vm_size
> >>
> >> <1> If the paddr == paddr1, then continue;
> >> <2> If the paddr == paddr2~paddr4 and paddr_end > phys_addr_end,
> >>     then continue;
> >> <3> if the paddr >= paddr5 then continue;
> >>
> >> Signed-off-by: Richard Lee <superlibj8301@...il.com>
> >
> > instead of doing this repeatedly, why not simply ensure the recorded
> > static vm information is already page aligned in the first place?
> >
> 
> Sorry, I'm not very sure what vm information you meant here.
> 
> And the 'svm->vm->addr' and 'svm->vm->size' are all page aligned
> already, but we cannot make sure that the 'paddr' and
> 'svm->vm->phys_addr' are page aligned.

If ->vm->addr is page aligned, then ->vm->phys_addr must be page aligned 
as well.  The hardware does virtual to physical mappings on a page 
granularity.  It is then not important to align paddr for the purpose of 
the search.

In other words, I fail to understand what problem your patch solves.


Nicolas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ