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 1/3] syscalls/capset02: Cleanup & convert to new library
Date: Wed, 15 Jan 2020 14:43:12 +0100	[thread overview]
Message-ID: <20200115134311.GE14046@rei.lan> (raw)
In-Reply-To: <1578651702-19486-1-git-send-email-xuyang2018.jy@cn.fujitsu.com>

Hi!
Pushed with minor changes, thanks.

The diff is:

diff --git a/testcases/kernel/syscalls/capset/capset02.c b/testcases/kernel/syscalls/capset/capset02.c
index 15589d462..a6c4f29a0 100644
--- a/testcases/kernel/syscalls/capset/capset02.c
+++ b/testcases/kernel/syscalls/capset/capset02.c
@@ -28,10 +28,11 @@
 #define CAP1 (1 << CAP_NET_RAW | 1 << CAP_CHOWN  | 1 << CAP_SETPCAP)
 #define CAP2 (CAP1 | 1 << CAP_KILL)
 
-static int drop_flag;
 static struct __user_cap_header_struct *header;
 static struct __user_cap_data_struct *data;
 
+static void *bad_addr;
+
 static struct tcase {
        int version;
        int pid;
@@ -63,8 +64,8 @@ static void verify_capset(unsigned int n)
 
        tst_res(TINFO, "%s", tc->message);
 
-       TEST(tst_syscall(__NR_capset, tc->flag - 1 ? header : NULL,
-                               tc->flag - 2 ? data : NULL));
+       TEST(tst_syscall(__NR_capset, tc->flag - 1 ? header : bad_addr,
+                               tc->flag - 2 ? data : bad_addr));
        if (TST_RET == 0) {
                tst_res(TFAIL, "capset() succeed unexpectedly");
                return;
@@ -97,9 +98,9 @@ static void setup(void)
 
        TEST(prctl(PR_CAPBSET_DROP, CAP_KILL));
        if (TST_RET == -1)
-               tst_res(TFAIL | TTERRNO, "drop CAP_KILL failed");
-       else
-               drop_flag = 1;
+               tst_brk(TBROK | TTERRNO, "drop CAP_KILL failed");
+
+       bad_addr = tst_get_bad_addr(NULL);
 }


-- 
Cyril Hrubis
chrubis@suse.cz

  parent reply	other threads:[~2020-01-15 13:43 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17 10:12 [LTP] [PATCH v1 0/4] cleanup capset testcase Yang Xu
2019-12-17 10:12 ` [LTP] [PATCH v1 1/4] syscalls/capset01: Cleanup & convert to new library Yang Xu
2020-01-07 13:32   ` Cyril Hrubis
2020-01-08  2:37     ` Yang Xu
2019-12-17 10:12 ` [LTP] [PATCH v1 2/4] syscalls/capset02: " Yang Xu
2019-12-17 10:12 ` [LTP] [PATCH v1 3/4] syscalls/capset03: add new EPERM error test without CAP_SETPCAP Yang Xu
2020-01-07 13:39   ` Cyril Hrubis
2020-01-08  3:19     ` Yang Xu
2020-01-08 11:03       ` Cyril Hrubis
2020-01-09  6:17         ` Yang Xu
2020-01-09 12:41           ` Cyril Hrubis
2020-01-10  5:35             ` Yang Xu
2020-01-10 10:21             ` [LTP] [PATCH v2 1/3] syscalls/capset02: Cleanup & convert to new library Yang Xu
2020-01-10 10:21               ` [LTP] [PATCH v2 2/3] syscalls/capset03: add new EPERM error test without CAP_SETPCAP Yang Xu
2020-01-15 14:28                 ` Cyril Hrubis
2020-01-10 10:21               ` [LTP] [PATCH v2 3/3] syscalls/capset04: add new EPERM error test with vfs cap support Yang Xu
2020-01-15 14:28                 ` Cyril Hrubis
2020-01-10 14:30               ` [LTP] [PATCH v2 1/3] syscalls/capset02: Cleanup & convert to new library Cyril Hrubis
2020-01-13  1:31                 ` Yang Xu
2020-01-15 13:43               ` Cyril Hrubis [this message]
2019-12-17 10:12 ` [LTP] [PATCH v3 4/5] syscalls/quotactl05: add project quota test for xfs filesystem Yang Xu
2019-12-17 10:16   ` Yang Xu

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=20200115134311.GE14046@rei.lan \
    --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