From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v1] Add test case for CVE-2018-11508
Date: Tue, 11 Aug 2020 16:07:53 +0200 [thread overview]
Message-ID: <20200811140753.GA1292@yuki.lan> (raw)
In-Reply-To: <20200620063713.5330-1-niravparmar@zilogic.com>
Hi!
Pushed with some changes, explained below, thanks.
diff --git a/testcases/kernel/syscalls/adjtimex/adjtimex03.c b/testcases/kernel/syscalls/adjtimex/adjtimex03.c
index d6c8d67e5..263391c90 100644
--- a/testcases/kernel/syscalls/adjtimex/adjtimex03.c
+++ b/testcases/kernel/syscalls/adjtimex/adjtimex03.c
@@ -33,13 +33,9 @@
#include <sys/timex.h>
#include "tst_test.h"
-#define SET_MODE (ADJ_OFFSET | ADJ_FREQUENCY | ADJ_MAXERROR | ADJ_ESTERROR | \
- ADJ_STATUS | ADJ_TIMECONST | ADJ_TICK)
-
#define ADJ_ADJTIME 0x8000
#define LOOPS 10
-static struct timex *tim_save;
static struct timex *buf;
void verify_adjtimex(void)
@@ -54,7 +50,7 @@ void verify_adjtimex(void)
if ((TST_RET == -1) && (TST_ERR == EINVAL)) {
tst_res(TINFO,
"expecting adjtimex() to fail with EINVAL"
- "with mode 0x%x", ADJ_ADJTIME);
+ " with mode 0x%x", ADJ_ADJTIME);
} else {
tst_brk(TBROK | TERRNO,
"adjtimex(): Unexpeceted error,"
@@ -75,38 +71,15 @@ void verify_adjtimex(void)
tst_res(TPASS, "Data leak not observed");
}
-static void setup(void)
-{
- tim_save->modes = 0;
- /* Save current parameters */
- if ((adjtimex(tim_save)) == -1) {
- tst_brk(TBROK | TERRNO,
- "adjtimex(): failed to save current params");
- }
-}
-
-static void cleanup(void)
-{
- tim_save->modes = SET_MODE;
-
- /* Restore saved parameters */
- if ((adjtimex(tim_save)) == -1)
- tst_res(TWARN, "Failed to restore saved parameters");
-}
There is no point in saving and restoring anything if we pass invalid
mode.
static struct tst_test test = {
- .setup = setup,
- .cleanup = cleanup,
- .min_kver = "4.16.9",
Also we do not restrict regression test to any kernel version, this
would for example restrict the test from running on stable kernel trees
or distribution kernels where the fix should have been backported.
.test_all = verify_adjtimex,
.bufs = (struct tst_buffers []) {
{&buf, .size = sizeof(*buf)},
- {&tim_save, .size = sizeof(*tim_save)},
{},
},
.tags = (const struct tst_tag[]) {
{"CVE", "2018-11508"},
- {"linux-git", "3a4d44b61625"},
+ {"linux-git", "0a0b98734479"},
We put in the hash that fixed the problem, not the one that introduced
it. We do not track where bugs were introduced in LTP only where they
were fixed.
{},
}
};
--
Cyril Hrubis
chrubis@suse.cz
next prev parent reply other threads:[~2020-08-11 14:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-20 6:37 [LTP] [PATCH v1] Add test case for CVE-2018-11508 Nirav Parmar
2020-06-20 9:24 ` Petr Vorel
2020-08-11 14:07 ` Cyril Hrubis [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-06-22 9:49 niravparmar
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=20200811140753.GA1292@yuki.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