Skip to contentSkip to conversation

MMAP_MIN_ADDR problem/question

DISCUSSION Marek Vasut 3 participants 3 messages Aug 2, 2012 – Aug 3, 2012

lore
Share & tools
lore
#0 lore raw

Hi guys,

Me and a coleague of mine recently ran into the issue [1]. The problem is, that I set mmap_min_addr to 65536, making it unable for "su - user" command to work, it crashes with SIGKILL. I now at least see a solution (set it to 32768). Though I don't understand why. Can someone please exaplain me why it has to be 32768 an not more?

[1] http://ubuntu.5.n6.nabble.com/PATCH-DEFAULT-MMAP-MIN-ADDR-32768-for-arm-
td1604723.html

Thanks in advance!

Best regards,
Marek Vasut

#1 lore raw

Dear Wolfram,

Quoted 8 lines · In message <[email protected]> Marek Vasut wrote:

Me and a coleague of mine recently ran into the issue [1]. The problem is, that I set mmap_min_addr to 65536, making it unable for "su - user" command to work, it crashes with SIGKILL. I now at least see a solution (set it to 32768). Though I don't understand why. Can someone please exaplain me why it has to be 32768 an not more?

[1] http://ubuntu.5.n6.nabble.com/PATCH-DEFAULT-MMAP-MIN-ADDR-32768-for-arm-td1604723.html

It appears the problem was introduced with commit cde7c41 "ARM:
configs: add defconfig for mach-mxs" which sets the default for CONFIG_DEFAULT_MMAP_MIN_ADDR for MXS systems to 64 k.

"security/Kconfig" has somewhat related documentation:

	config LSM_MMAP_MIN_ADDR
	...
		default 32768 if ARM
		default 65536
		...
		On arm and other archs it should not be higher than 32768.

The reason is that on ARM the text segment of applications gets mapped to 32 k, which fails for non-root processes if MMAP_MIN_ADDR is higher.

Is there any specific reason why you set it to 64 k for MXS ?

Can you please check if non-root processes work for you with this configuration?

Thanks.

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I used to be indecisive, now I'm not sure.
#2 lore raw
In reply to Marek Vasut
Quoted 10 lines · Marek Vasut

Hi guys,

Me and a coleague of mine recently ran into the issue [1]. The problem is, that I set mmap_min_addr to 65536, making it unable for "su - user" command to work, it crashes with SIGKILL. I now at least see a solution (set it to 32768). Though I don't understand why. Can someone please exaplain me why it has to be 32768 an not more?

[1] http://ubuntu.5.n6.nabble.com/PATCH-DEFAULT-MMAP-MIN-ADDR-32768-for-arm-
td1604723.html

Looks to me like there's a reading exercise for someone in the MXS community who set the default to 64K. The default in the Kconfig is already appropriately chosen, so for the defconfig to have the 64K value, someone must have _intentionally_ changed it without thinking about what they were doing.

Just produce a patch to fix the defconfig.