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: <538F09B4.8090308@uclinux.org>
Date:	Wed, 04 Jun 2014 21:57:40 +1000
From:	Greg Ungerer <gerg@...inux.org>
To:	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>
CC:	Rabin Vincent <rabin@....in>, Will Deacon <will.deacon@....com>,
	linux-arm-kernel@...ts.infradead.org,
	linux-xtensa@...ux-xtensa.org, linux-m32r@...linux-m32r.org,
	linux-c6x-dev@...ux-c6x.org, microblaze-uclinux@...e.uq.edu.au,
	linux-kernel@...r.kernel.org, David Howells <dhowells@...hat.com>,
	linux-mm@...ck.org, linux-m68k@...ts.linux-m68k.org,
	kernel@...gutronix.de, uclinux-dist-devel@...ckfin.uclinux.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	panchaxari <panchaxari.prasannamurthy@...aro.org>,
	Linus Walleij <linus.walleij@...aro.org>
Subject: Re: TASK_SIZE for !MMU


Hi Uwe,

On 04/06/14 00:11, Uwe Kleine-König wrote:
> On Tue, Jun 03, 2014 at 10:14:55PM +1000, Greg Ungerer wrote:
>>>> I think it would be OK to define TASK_SIZE to 0xffffffff for !MMU.
>>>> blackfin, frv and m68k also do this. c6x does define it to 0xFFFFF000 to
>>>> leave space for error codes.
>>
>> I did that same change for m68k in commit cc24c40 ("m68knommu: remove
>> size limit on non-MMU TASK_SIZE"). For similar reasons as you need to
>> now.
> ok.
>
>>>> Thoughts?
>>> The problem is that current linus/master (and also next) doesn't boot on
>>> my ARM-nommu machine because the user string functions (strnlen_user,
>>> strncpy_from_user et al.) refuse to work on strings above TASK_SIZE
>>> which in my case also includes the XIP kernel image.
>>
>> I seem to recall that we were not considering flash or anything else
>> other than RAM when defining that original TASK_SIZE (back many, many
>> years ago). Some of the address checks you list above made some sense
>> if you had everything in RAM (though only upper bounds are checked).
>> The thinking was some checking is better than none I suppose.
> What is the actual meaning of TASK_SIZE? The maximal value of a valid
> userspace address?

Yes (as Geert pointed out :-)
The limit of virtual userspace addresses.


>> Setting a hard coded memory size in CONFIG_DRAM_SIZE is not all that
>> fantastic either...
> Not sure what you mean? Having CONFIG_DRAM_SIZE at all or use it for
> boundary checking?

Having the DRAM size be a configure time constant. And as you have
found RAM isn't the only place in the physical address space that
code will necessarily access.


> CONFIG_DRAM_SIZE is hardly used apart from defining TASK_SIZE:
>
>   - #define END_MEM (UL(CONFIG_DRAM_BASE) + CONFIG_DRAM_SIZE)
>     which is only used to define MODULES_END. Ap
>   - Some memory configuration using cp15 registers in
>     arch/arm/mm/proc-arm{740,940,946}.S
>
> For the former I'd say better use 0xffffffff, too. For the latter I
> wonder if we should just drop CPU_ARM740T, CPU_ARM940T and CPU_ARM946E.
> These are only selectable if ARCH_INTEGRATOR and are not selected by
> other symbols. As ARCH_INTEGRATOR selects ARM_PATCH_PHYS_VIRT since
> commit fe9891454473 (ARM: integrator: Default enable
> ARM_PATCH_PHYS_VIRT, AUTO_ZRELADDR) for Linux 3.13 and
> ARM_PATCH_PHYS_VIRT depends on MMU the Integrator-noMMU targets are
> broken anyhow.
>
> I will prepare a patch series with some cleanups.

I have no idea how many people would be using those older ARM CPU types.
It was hard to get much interest for them in mainline even years ago.

Regards
Greg



--
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