public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] syscalls/execveat01: new test to verify execveat unlinked fd
Date: Wed, 8 Aug 2018 16:41:55 +0200	[thread overview]
Message-ID: <20180808144155.GG19147@rei> (raw)
In-Reply-To: <CAEemH2f8di2qLvKPmutiO64w+YOxVbHxZgggvqtM-TPS5TU8eg@mail.gmail.com>

Hi!
> static void do_child(void)
> {
>     ...
> 
>     /* Check if system support execveat() correctly */
>     TEST(execveat(fd, "", argv, environ, AT_EMPTY_PATH));
>     /* Do TCONF if we get EINVAL here */
> 
>     SAFE_UNLINK(TEST_FILE_PATH);
> 
>     /* Do your testing */
>     TEST(execveat(fd, "", argv, environ, AT_EMPTY_PATH));
>     /* Here if we get EINVAL again that means hit a bug! */
> }
> 
> Did I miss anything?

It's a bit more complicated than that, we have to fork() first and run
the check in the child otherwise we will never get to the test code, as
we will either do tst_brk(TBROK) or execute the child code instead...

I will write the code to check it and amend the test before applying to
the tree.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2018-08-08 14:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-01  8:17 [LTP] [PATCH v2] syscalls/execveat01: new test to verify execveat unlinked fd Eddie.Horng
2018-08-01 11:17 ` Li Wang
2018-08-01 12:53   ` Cyril Hrubis
2018-08-03  9:32   ` Eddie Horng
2018-08-06  9:26     ` Li Wang
2018-08-08 14:41       ` Cyril Hrubis [this message]
2018-08-08 14:48         ` Cyril Hrubis
2018-08-09  9:04 ` Cyril Hrubis
2018-08-10  9:32   ` Eddie Horng
2018-09-11 15:24 ` Jan Stancek
2018-09-12  1:44   ` Eddie Horng
2018-09-12  7:04     ` Jan Stancek

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=20180808144155.GG19147@rei \
    --to=chrubis@suse.cz \
    --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