From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3 3/9] Test for CVE-2016-4997 on setsockopt
Date: Tue, 11 Jun 2019 11:14:09 +0200 [thread overview]
Message-ID: <20190611091409.GA5644@dell5510> (raw)
In-Reply-To: <20170623122211.29575-4-rpalethorpe@suse.com>
Hi Richard, Cyril,
looking at this LTP test (3be0d391f renamed it into
testcases/kernel/syscalls/setsockopt/setsockopt03.c).
> Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
> ---
> testcases/cve/cve-2016-4997.c | 92 +++++++++++++++++++++++++++++++++++++++++++
...
> +static void setup(void)
> +{
> + if (tst_kernel_bits() == 32 || sizeof(long) > 4)
> + tst_res(TCONF,
> + "The vulnerability was only present in 32-bit compat mode");
Was it intentional to run it on normal 64bit?
Shouldn't it be tst_brk(TCONF, ...) used?
Kind regards,
Petr
> +}
> +
> +static void run(void)
> +{
> + int ret, sock_fd;
> + struct payload p = { 0 };
> +
> + sock_fd = SAFE_SOCKET(AF_INET, SOCK_DGRAM, 0);
> +
> + strncpy(p.match.u.user.name, "icmp", sizeof(p.match.u.user.name));
> + p.match.u.match_size = OFFSET_OVERWRITE;
> +
> + p.ent.next_offset = NEXT_OFFSET;
> + p.ent.target_offset = TOO_SMALL_OFFSET;
> +
> + p.repl.num_entries = 2;
> + p.repl.num_counters = 1;
> + p.repl.size = sizeof(struct payload);
> + p.repl.valid_hooks = 0;
> +
> + ret = setsockopt(sock_fd, SOL_IP, IPT_SO_SET_REPLACE,
> + &p, sizeof(struct payload));
> + tst_res(TPASS | TERRNO, "We didn't cause a crash, setsockopt returned %d", ret);
> +}
> +
> +static struct tst_test test = {
> + .min_kver = "2.6.32",
> + .setup = setup,
> + .test_all = run,
> + .needs_root = 1,
> +};
next prev parent reply other threads:[~2019-06-11 9:14 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-23 12:22 [LTP] [PATCH v3 0/9] CVE Tests Richard Palethorpe
2017-06-23 12:22 ` [LTP] [PATCH v3 1/9] Add fuzzy synchronisation library for triggering races Richard Palethorpe
2017-07-19 9:13 ` Cyril Hrubis
2017-07-25 12:22 ` Richard Palethorpe
2017-06-23 12:22 ` [LTP] [PATCH v3 2/9] Test for vulnerability CVE-2016-7117 in recvmmsg error return path Richard Palethorpe
2017-07-19 9:39 ` Cyril Hrubis
2017-06-23 12:22 ` [LTP] [PATCH v3 3/9] Test for CVE-2016-4997 on setsockopt Richard Palethorpe
2017-07-19 10:35 ` Cyril Hrubis
2019-06-11 9:14 ` Petr Vorel [this message]
2017-06-23 12:22 ` [LTP] [PATCH v3 4/9] Test for uname26 exploit CVE-2012-0957 Richard Palethorpe
2017-07-19 10:44 ` Cyril Hrubis
2017-06-23 12:22 ` [LTP] [PATCH v3 5/9] Add CVE .gitignore, Makefile and runtest files Richard Palethorpe
2017-07-19 11:51 ` Cyril Hrubis
2017-06-23 12:22 ` [LTP] [PATCH v3 6/9] Test for CVE-2014-0196 PTY echo race Richard Palethorpe
2017-07-19 13:01 ` Cyril Hrubis
2017-06-23 12:22 ` [LTP] [PATCH v3 7/9] Test for CVE-2017-5669 in shmat Richard Palethorpe
2017-07-19 13:19 ` Cyril Hrubis
2017-07-19 14:02 ` Richard Palethorpe
2017-07-19 14:50 ` Cyril Hrubis
2017-07-20 10:09 ` [LTP] [PATCH v4] " Richard Palethorpe
2017-07-20 11:13 ` Cyril Hrubis
2017-06-23 12:22 ` [LTP] [PATCH v3 8/9] Test for CVE-2017-6951 in request_key Richard Palethorpe
2017-07-19 13:23 ` Cyril Hrubis
2017-06-23 12:22 ` [LTP] [PATCH v3 9/9] Test for CVE-2017-2671 on ping sockets Richard Palethorpe
2017-07-20 12:08 ` Cyril Hrubis
2017-07-24 8:53 ` [LTP] [PATCH v4] " Richard Palethorpe
2017-07-27 13:25 ` Cyril Hrubis
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=20190611091409.GA5644@dell5510 \
--to=pvorel@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