public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 3/3] syscalls/shmat03.c: add new regression test
Date: Thu, 22 Jun 2017 08:02:16 -0400 (EDT)	[thread overview]
Message-ID: <1869831182.41262364.1498132936147.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <594BA513.5010705@cn.fujitsu.com>



----- Original Message -----
> From: "Xiao Yang" <yangx.jy@cn.fujitsu.com>
> To: "Cyril Hrubis" <chrubis@suse.cz>, "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp@lists.linux.it
> Sent: Thursday, 22 June, 2017 1:08:03 PM
> Subject: Re: [LTP] [PATCH 3/3] syscalls/shmat03.c: add new regression test
> 
> On 2017/06/22 18:09, Xiao Yang wrote:
> > On 2017/06/01 19:53, Xiao Yang wrote:
> >> On 2017/05/29 22:57, Cyril Hrubis wrote:
> >>> Hi!
> >>>> +    addr = shmat(shm_id, LOCATION, SHM_RND);
> >>>> +    if (addr != (void *)-1)
> >>>> +        tst_res(TINFO, "shmat() attached a nil-page unexpectedly");
> >>>> +    else
> >>>> +        tst_res(TINFO, "shmat() didn't attach a nil-page");
> >>>> +
> >>>> +    ((char *)addr)[0] = 'A';
> >>>
> >>> So if shmat() fails we try to write to (char*)-1 address, that does not
> >>> sound right. Why don't we exit the test with TPASS in that case and
> >>> skip
> >>> the part that tries to write to invalid address?
> >>>
> >>> Or at least dereference NULL here instead of the address returned from
> >>> shmat() since that is guaranteed to SEGFAULT.
> >> Hi Cyril
> >>
> >> I failed to call shmat() as root and returned EACCES if selinux is
> >> Enforcing.
> >> Do you know how to fix this problem?
> > Hi Cyril
> >
> > Sorry, I have fixed this issue, I will send v3 patch soon.
> Hi Cyril and jan
> 
> Sorry, i tried to fix this issue, but failed.  Could you help me to
> look into it? Thanks a lot! :-(
> shmat() only attached a nil-page as root when selinux is not Enforcing.

Hi,

as Richard mentioned already, this appears to be same test as his:
  http://lists.linux.it/pipermail/ltp/2017-May/004568.html

so I guess we can drop 3/3 from your set, and use Richard's
version, which is doing what Cyril suggested.

Regards,
Jan

  reply	other threads:[~2017-06-22 12:02 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-14 10:15 [LTP] [PATCH 1/3] tst_safe_sysv_ipc: add shared memory related macros Xiao Yang
2017-04-14 10:15 ` [LTP] [PATCH 2/3] syscalls/shmat0*: cleanup && convert to new API Xiao Yang
2017-05-29 14:11   ` Cyril Hrubis
2017-06-01  9:03     ` Xiao Yang
2017-04-14 10:15 ` [LTP] [PATCH 3/3] syscalls/shmat03.c: add new regression test Xiao Yang
2017-05-29 14:57   ` Cyril Hrubis
2017-06-01 11:49     ` [LTP] [PATCH v2 1/3] tst_safe_sysv_ipc: add shared memory related macros Xiao Yang
2017-06-01 11:49       ` [LTP] [PATCH v2 2/3] syscalls/shmat0*: cleanup && convert to new API Xiao Yang
2017-06-29 16:14         ` Cyril Hrubis
2017-06-30  2:30           ` [LTP] [PATCH v3] " Xiao Yang
2017-06-30 14:54             ` Cyril Hrubis
2017-07-03  3:09               ` [LTP] [PATCH v4] " Xiao Yang
2017-07-07 12:29                 ` Cyril Hrubis
2017-06-01 11:49       ` [LTP] [PATCH v2 3/3] syscalls/shmat03.c: add new regression test Xiao Yang
2017-06-22  9:41       ` [LTP] [PATCH v2 1/3] tst_safe_sysv_ipc: add shared memory related macros Xiao Yang
2017-06-22 15:29       ` Cyril Hrubis
2017-06-01 11:53     ` [LTP] [PATCH 3/3] syscalls/shmat03.c: add new regression test Xiao Yang
2017-06-22 10:09       ` Xiao Yang
2017-06-22 11:08         ` Xiao Yang
2017-06-22 12:02           ` Jan Stancek [this message]
2017-06-22 15:11             ` [LTP] [PATCH v2 2/2] clone09: add a test for CLONE_NEWNET flag Cyril Hrubis
2017-06-23  7:22               ` Richard Palethorpe
2017-06-23  1:07             ` [LTP] [PATCH 3/3] syscalls/shmat03.c: add new regression test Xiao Yang
2017-06-20 13:40     ` Richard Palethorpe
2017-05-19  1:19 ` [LTP] [PATCH 1/3] tst_safe_sysv_ipc: add shared memory related macros Xiao Yang

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=1869831182.41262364.1498132936147.JavaMail.zimbra@redhat.com \
    --to=jstancek@redhat.com \
    --cc=ltp@lists.linux.it \
    /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