From: Michal Simek <monstr@monstr.eu>
To: Linux Kernel list <linux-kernel@vger.kernel.org>,
Arnd Bergmann <arnd@arndb.de>,
LTP <ltp-list@lists.sourceforge.net>
Subject: access_ok macor
Date: Tue, 14 Jul 2009 14:56:08 +0200 [thread overview]
Message-ID: <4A5C8068.6020203@monstr.eu> (raw)
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
next reply other threads:[~2009-07-14 12:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-14 12:56 Michal Simek [this message]
2009-07-14 13:21 ` access_ok macor Arnd Bergmann
2009-07-14 13:45 ` Michal Simek
2009-07-14 14:45 ` Arnd Bergmann
2009-07-14 15:06 ` Michal Simek
[not found] ` <200907141652.59049.arnd@arndb.de>
[not found] ` <4A5CAEFF.9080206@monstr.eu>
2009-07-14 16:43 ` Arnd Bergmann
2009-07-14 16:56 ` Michal Simek
2009-07-14 17:13 ` Arnd Bergmann
2009-07-14 17:45 ` Michal Simek
2009-07-15 9:21 ` Paul Mundt
2009-07-15 10:03 ` Michal Simek
[not found] ` <9e6f3dfd0907141811p512b4edp3f9dd0fdeae1123e@mail.gmail.com>
2009-07-15 10:14 ` Arnd Bergmann
2009-07-15 11:39 ` Michal Simek
2009-07-15 12:05 ` Ralf Baechle
2009-07-15 13:27 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A5C8068.6020203@monstr.eu \
--to=monstr@monstr.eu \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=ltp-list@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox