[PATCH] ARM: Remove address checking for MMUless devices

Ard Biesheuvel ardb at kernel.org
Wed Jun 12 00:03:59 PDT 2024


On Wed, 12 Jun 2024 at 09:01, Yanjun Yang <yangyj.ee at gmail.com> wrote:
>
> On Wed, Jun 12, 2024 at 2:43 PM Ard Biesheuvel <ardb at kernel.org> wrote:
> >
> > On Wed, 12 Jun 2024 at 03:26, Yanjun Yang <yangyj.ee at gmail.com> wrote:
> > >
> > > Hi,
> > > Apologies for not CCing the relevant maintainers in my previous email.
> > >
> > > On Tue, Jun 11, 2024 at 6:09 PM Yanjun Yang <yangyj.ee at gmail.com> wrote:
> > > >
> > > > Commit 169f9102f9198b ("ARM: 9350/1: fault:
> > > > Implement copy_from_kernel_nofault_allowed()") added the function to check
> > > > address before use. However, for devices without MMU, addr > TASK_SIZE
> > > > will always fail.
> >
> > Is that true? Doesn't it depend on the physical memory layout of the
> > platform in question?
> >
>
> I only checked the ARM architecture, in arch/arm/include/asm/memory.h
> TASK_SIZE is
> defined as 0xffffffff when CONFIG_MMU is not defined.  Following is
> the code snippet.
> /*
>  * The limitation of user task size can grow up to the end of free ram region.
>  * It is difficult to define and perhaps will never meet the original meaning
>  * of this define that was meant to.
>  * Fortunately, there is no reference for this in noMMU mode, for now.
>  */
> #define TASK_SIZE               UL(0xffffffff)
>

OK, I stand corrected. Thanks for the explanation.



More information about the linux-arm-kernel mailing list