public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Caspar Zhang <caspar@casparzhang.com>
To: Monson Shao <jshao@redhat.com>
Cc: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] pidns30 pidns31: syscall mq_open() failed EFAULT(Bad address)
Date: Wed, 26 Dec 2012 10:57:33 +0800	[thread overview]
Message-ID: <50DA679D.7010502@casparzhang.com> (raw)
In-Reply-To: <1356434591.8314.36.camel@station.monson>

On 12/25/2012 07:23 PM, Monson Shao wrote:
> On Tue, 2012-12-25 at 15:42 +0800, Caspar Zhang wrote:
>> On 12/25/2012 03:25 PM, Monson Shao wrote:
>>> 'man 3 mq_open' said mq_open() can take 2 or 4 arguments, but the implement
>>> syscall(__NR_mq_open, ...) takes 4, according to [1].
>>>
>>> Manually tested on kernel-3.6.0 with glibc-2.16 .
>>>
>>> [1] glibc/sysdeps/unix/sysv/linux/mq_open.c:55
>>
>> will this change the result on old kernel/glibc?
>>
>> Caspar
> I haven't tested it on old kernel/glibc, but 4 arguments should always
> be acceptable, since this usage exists in the same file [2].

Makes sense.

Reviewed-by: Caspar Zhang <caspar@casparzhang.com>

>
> [2] testcases/kernel/containers/pidns/pidns30.c:255
>>
>>>
>>> Signed-off-by: Monson Shao <jshao@redhat.com>
>>> ---
>>>    testcases/kernel/containers/pidns/pidns30.c | 2 +-
>>>    testcases/kernel/containers/pidns/pidns31.c | 2 +-
>>>    2 个文件被修改,插入 2 行(+),删除 2 行(-)
>>>
>>> diff --git a/testcases/kernel/containers/pidns/pidns30.c b/testcases/kernel/containers/pidns/pidns30.c
>>> index 71e87c1..75c736b 100644
>>> --- a/testcases/kernel/containers/pidns/pidns30.c
>>> +++ b/testcases/kernel/containers/pidns/pidns30.c
>>> @@ -186,7 +186,7 @@ int child_fn(void *arg)
>>>    	while (read(father_to_child[0], buf, 1) != 1)
>>>    		sleep(1);
>>>
>>> -	mqd = syscall(__NR_mq_open, mqname, O_RDONLY);
>>> +	mqd = syscall(__NR_mq_open, mqname, O_RDONLY, 0, NULL);
>>>    	if (mqd == -1) {
>>>    		perror("mq_open failed");
>>>    		return 1;
>>> diff --git a/testcases/kernel/containers/pidns/pidns31.c b/testcases/kernel/containers/pidns/pidns31.c
>>> index 2a07489..1498d16 100644
>>> --- a/testcases/kernel/containers/pidns/pidns31.c
>>> +++ b/testcases/kernel/containers/pidns/pidns31.c
>>> @@ -177,7 +177,7 @@ int child_fn(void *arg)
>>>    	}
>>>    	tst_resm(TINFO, "cinit: my father is ready to receive a message");
>>>
>>> -	mqd = syscall(__NR_mq_open, mqname, O_WRONLY);
>>> +	mqd = syscall(__NR_mq_open, mqname, O_WRONLY, 0, NULL);
>>>    	if (mqd == (mqd_t) - 1) {
>>>    		tst_resm(TBROK, "cinit: mq_open() failed (%s)",
>>>    			 strerror(errno));
>>>
>>
>


------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

  reply	other threads:[~2012-12-26  2:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-25  7:25 [LTP] [PATCH] pidns30 pidns31: syscall mq_open() failed EFAULT(Bad address) Monson Shao
2012-12-25  7:42 ` Caspar Zhang
2012-12-25 11:23   ` Monson Shao
2012-12-26  2:57     ` Caspar Zhang [this message]
2012-12-26  3:37       ` Wanlong Gao

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=50DA679D.7010502@casparzhang.com \
    --to=caspar@casparzhang.com \
    --cc=jshao@redhat.com \
    --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