lkml.org 
[lkml]   [2009]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectaccess_ok macor
Hi,

I am trying to solve one thing around access_ok macro.
Microblaze memory map is below
Text address for user app is 0x1000 0000
for library 0x4800 0000
and stack below 0xc000 0000


# cat /proc/1/maps
10000000-10106000 r-xp 00000000 00:01 379 /bin/busybox
10106000-10107000 rw-p 00106000 00:01 379 /bin/busybox
10107000-1012a000 rwxp 00000000 00:00 0 [heap]
48000000-4801c000 r-xp 00000000 00:01 400 /lib/ld-2.3.3.so
4801c000-4801e000 rw-p 0001b000 00:01 400 /lib/ld-2.3.3.so
4801e000-480ec000 r-xp 00000000 00:01 396 /lib/libm-2.3.3.so
480ec000-480ee000 rw-p 000ce000 00:01 396 /lib/libm-2.3.3.so
480ee000-4824c000 r-xp 00000000 00:01 390 /lib/libc-2.3.3.so
4824c000-4824f000 r--p 0015d000 00:01 390 /lib/libc-2.3.3.so
4824f000-48251000 rw-p 00160000 00:01 390 /lib/libc-2.3.3.so
48251000-48255000 rw-p 00000000 00:00 0
bfa38000-bfa4d000 rwxp 00000000 00:00 0 [stack]
#

I found that I can setup text base in binutils/ld/emulparam/elf32mb_linux.sh

The problem which I have is that if I run socketpair, getsockname, getpeername LTP
tests with invalid salen pointer there are addresses close to 0x0. Microblaze
has no text there and the sigsegv fault is generated.

This fault could be fixed by changed access_ok macro where I check bottom limit
at 0x1000 0000 too. After this change the LTP program not failed but I am not sure
if is the right solution because none arch do it. All archs just check upper limit
not lower.

What is the correct solution for it? Moving .text base to 0x0 or is there any other
elegant solution?

Thanks,
Michal




--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854


\
 
 \ /
  Last update: 2009-07-14 14:59    [W:0.099 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site