All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@petalogix.com>
To: subrata@linux.vnet.ibm.com, LTP <ltp-list@lists.sourceforge.net>
Subject: [LTP] getpeername01, getsockname01, socketpair01
Date: Thu, 02 Jul 2009 09:35:04 +0200	[thread overview]
Message-ID: <4A4C6328.6060405@petalogix.com> (raw)

Hi,

Can someone explain me why is in that subject tests for invalid pointer
choose
address 1 (or 7 in socketpair01)? I did some tests on Microblaze and for
this address I am getting segfault.
That's the reason why I think that problem is in glibc or ltp test. All
tests test reaction for invalid pointer address.

The interesting is that any address from 1 to 999 9999 caused segfault.
Address above not.
Below is memory map but first segment starts at 0x1000 0000 not 1000
0000 which is in patches below and works.

# cat /proc/66/maps
10000000-10001000 r-xp 00000000 00:01 394        /opcoded
10001000-10002000 rw-p 00000000 00:01 394        /opcoded
48000000-4801c000 r-xp 00000000 00:01 389        /lib/ld-2.3.3.so
4801c000-4801e000 rw-p 0001b000 00:01 389        /lib/ld-2.3.3.so
4801e000-4817c000 r-xp 00000000 00:01 379        /lib/libc-2.3.3.so
4817c000-4817f000 r--p 0015d000 00:01 379        /lib/libc-2.3.3.so
4817f000-48181000 rw-p 00160000 00:01 379        /lib/libc-2.3.3.so
48181000-48186000 rw-p 00000000 00:00 0
bfc15000-bfc2a000 rwxp 00000000 00:00 0          [stack]


Below are my changes which jump over segfault but they are still invalid
pointer.
Has someone ever met with this problem before?

Patches below are on this link too.
http://developer.petalogix.com/git/gitweb.cgi?p=ltp-microblaze.git;a=commitdiff;h=45f4cd783ce8b94f1267bb87c0c46e8536f62eca

Thanks,
Michal


diff --git a/testcases/kernel/syscalls/getpeername/getpeername01.c
b/testcases/kernel/syscalls/getpeername/getpeername01.c
index 55d349a..3ae015d 100644 (file)
--- a/testcases/kernel/syscalls/getpeername/getpeername01.c
+++ b/testcases/kernel/syscalls/getpeername/getpeername01.c
@@ -93,7 +93,7 @@ struct test_case_t {          /* test case structure */
                    &sinlen, -1, EFAULT, setup2, cleanup1,
                    "invalid socket buffer"}, {
        PF_UNIX, SOCK_STREAM, 0, (struct sockaddr *)&fsin1,
-                   (socklen_t *) 1, -1, EFAULT, setup2, cleanup1,
+                   (socklen_t *) 10000000, -1, EFAULT, setup2, cleanup1,
                    "invalid salen"},
 #endif
 };

diff --git a/testcases/kernel/syscalls/getsockname/getsockname01.c
b/testcases/kernel/syscalls/getsockname/getsockname01.c
index 6159847..2020230 100644 (file)
--- a/testcases/kernel/syscalls/getsockname/getsockname01.c
+++ b/testcases/kernel/syscalls/getsockname/getsockname01.c
@@ -90,7 +90,7 @@ struct test_case_t {          /* test case structure */
                    &sinlen, -1, EFAULT, setup1, cleanup1,
                    "invalid socket buffer"}, {
        PF_INET, SOCK_STREAM, 0, (struct sockaddr *)&fsin1,
-                   (socklen_t *) 1, -1, EFAULT, setup1, cleanup1,
+                   (socklen_t *) 1000000, -1, EFAULT, setup1, cleanup1,
                    "invalid salen"},
 #endif
 };

diff --git a/testcases/kernel/syscalls/socketpair/socketpair01.c
b/testcases/kernel/syscalls/socketpair/socketpair01.c
index fc90529..f8c29c0 100644 (file)
--- a/testcases/kernel/syscalls/socketpair/socketpair01.c
+++ b/testcases/kernel/syscalls/socketpair/socketpair01.c
@@ -81,7 +81,7 @@ struct test_case_t {          /* test case structure */
            /* Skip since uClinux does not implement memory protection */
        {
        PF_UNIX, SOCK_STREAM, 0, 0, -1, EFAULT, "bad pointer"}, {
-       PF_UNIX, SOCK_STREAM, 0, (int *)7, -1, EFAULT, "bad pointer"},
+       PF_UNIX, SOCK_STREAM, 0, (int *)10000000, -1, EFAULT, "bad
pointer"},
 #endif
        {
        PF_INET, SOCK_DGRAM, 17, sv, -1, EOPNOTSUPP, "UDP socket"}, {


-- 
Michal Simek, Ing. (M.Eng)
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663


------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

             reply	other threads:[~2009-07-02  7:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-02  7:35 Michal Simek [this message]
2009-07-06 15:50 ` [LTP] getpeername01, getsockname01, socketpair01 Subrata Modak
2009-07-06 16:17   ` Michal Simek

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=4A4C6328.6060405@petalogix.com \
    --to=michal.simek@petalogix.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=subrata@linux.vnet.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.