Skip to contentSkip to conversation

Add support for a test tags

PATCH New Cyril Hrubis 4 participants 11 messages Oct 22, 2019 – Nov 6, 2019 Library code

lore
Share & tools
lore
#0 lore raw

v2 cover Add support for a test tags

This is a newest version of the test tags, first patch adds a support for test tags to a test library, the second one annotates tests with tags. Not everything is annotated at the moment but fair amount of tests is included.

These patches are also a stepping stone for the test metadata project that will allow us to do much more than this. You can have a look at:

https://github.com/metan-ucw/ltp/tree/master/docparse

Also if you run a make in the docparse directory it will generate test metadata along with a single html page with nice test metadata description.

While the whole project is work-in-progress, the test tags are finished and may add a value even without the rest of the changes, see the first commit for details.

Changes for v2:

- Made the output more compact both for the -h flag as well as for the failure annotation (see the first commit for example output)

- Changed function name from print_test_info() to print_test_tags()

- Converted two more {NULL, NULL} into {}

Cyril Hrubis (2):
lib: Add support for test tags
testcases/kernel: Add linux git and CVE tags

 include/tst_test.h                            | 10 ++
 lib/tst_test.c                                | 91 +++++++++++++++++--
 testcases/cve/cve-2014-0196.c                 |  5 +
 testcases/cve/cve-2015-3290.c                 |  5 +
 testcases/cve/cve-2016-10044.c                |  5 +
 testcases/cve/cve-2016-7042.c                 |  5 +
 testcases/cve/cve-2016-7117.c                 |  5 +
 testcases/cve/cve-2017-16939.c                |  5 +
 testcases/cve/cve-2017-17052.c                |  5 +
 testcases/cve/cve-2017-17053.c                |  5 +
 testcases/cve/cve-2017-2618.c                 |  5 +
 testcases/cve/cve-2017-2671.c                 |  5 +
 testcases/cve/meltdown.c                      |  6 +-
 testcases/cve/stack_clash.c                   |  4 +
 testcases/kernel/crypto/af_alg01.c            |  5 +
 testcases/kernel/crypto/af_alg02.c            |  5 +
 testcases/kernel/crypto/af_alg03.c            |  4 +
 testcases/kernel/crypto/af_alg04.c            |  4 +
 testcases/kernel/crypto/af_alg05.c            |  8 +-
 testcases/kernel/crypto/af_alg06.c            |  4 +
 testcases/kernel/crypto/crypto_user01.c       |  6 ++
 testcases/kernel/crypto/crypto_user02.c       |  4 +
 testcases/kernel/crypto/pcrypt_aead01.c       |  5 +
 testcases/kernel/sound/snd_timer01.c          |  6 ++
 testcases/kernel/syscalls/accept/accept02.c   |  5 +
 testcases/kernel/syscalls/acct/acct02.c       |  4 +
 testcases/kernel/syscalls/add_key/add_key02.c |  5 +
 testcases/kernel/syscalls/bpf/bpf_prog02.c    |  4 +
 testcases/kernel/syscalls/bpf/bpf_prog03.c    |  5 +
 .../syscalls/futex/futex_cmp_requeue02.c      |  5 +
 testcases/kernel/syscalls/keyctl/keyctl02.c   |  4 +
 testcases/kernel/syscalls/keyctl/keyctl04.c   |  5 +
 testcases/kernel/syscalls/keyctl/keyctl05.c   |  4 +
 .../kernel/syscalls/move_pages/move_pages12.c |  6 ++
 .../kernel/syscalls/realpath/realpath01.c     |  4 +
 .../syscalls/request_key/request_key05.c      |  4 +
 testcases/kernel/syscalls/sbrk/sbrk03.c       |  4 +
 testcases/kernel/syscalls/sendto/sendto02.c   |  4 +
 .../kernel/syscalls/setrlimit/setrlimit06.c   |  4 +
 39 files changed, 270 insertions(+), 9 deletions(-)
Signature · 1 line
2.21.0
#1 lore raw

PATCH v2 1/2 lib: Add support for test tags

The newly introduced test tags are generic name-value pairs that can hold test metadata, the intended use for now is to store kernel commit hashes for kernel reproducers as well as CVE ids. The mechanism is however choosen to be very generic so that it's easy to add basically any information later on.

As it is the main purpose is to print hints for a test failures. If a test that has been written as a kernel reproducer fails it prints nice URL pointing to a kernel commit that may be missing.

Example output:

--------------------------------------------------------------------------
snd_timer01.c:134: FAIL: kernel seems vulnerable

HINT: You _MAY_ be missing kernel fixes, see:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d11662f4f798
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ba3021b2c79b

HINT: You _MAY_ be vunerable to CVE(s), see:

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-1000380

Summary:

passed   0
failed   1
skipped  0

warnings 0
--------------------------------------------------------------------------

---
 include/tst_test.h | 10 +++++
 lib/tst_test.c     | 91 ++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 94 insertions(+), 7 deletions(-)
include/tst_test.h +10 -0
index 84acf2c59..4a51b6d16 100644
@@ -108,6 +108,11 @@ int tst_parse_int(const char *str, int *val, int min, int max);
 int tst_parse_long(const char *str, long *val, long min, long max);
 int tst_parse_float(const char *str, float *val, float min, float max);
 
+struct tst_tag {
+	const char *name;
+	const char *value;
+};
+
 extern unsigned int tst_variant;
 
 struct tst_test {
@@ -212,6 +217,11 @@ struct tst_test {
 	 * NULL-terminated array of capability settings
 	 */
 	struct tst_cap *caps;
+
+	/*
+	 * {NULL, NULL} terminated array of tags.
+	 */
+	const struct tst_tag *tags;
 };
 
 /*
lib/tst_test.c +84 -7

134 lines not on this page · raw message

Signature · 1 line
2.21.0
#2 lore raw

PATCH v2 1/2 lib: Add support for test tags

Hi Cyril,

lib/tst_test.c static void print_help(void) · line 421

Quoted 2 lines
lib/tst_test.c +2 -0
+	fprintf(stderr, "Options\n");
+	fprintf(stderr, "-------\n\n");

I still would remove this extra new line:

	fprintf(stderr, "-------\n");
Quoted 5 lines
lib/tst_test.c +1 -0
+
 	for (i = 0; i < ARRAY_SIZE(options); i++)
 		fprintf(stderr, "%s\n", options[i].help);

lib/tst_test.c static void print_help(void) · line 439

Quoted 10 lines
lib/tst_test.c +7 -0
@@ -424,6 +430,28 @@ static void print_help(void)
 		fprintf(stderr, "%s\n", tst_test->options[i].help);
 }
 
+static void print_test_tags(void)
+{
+	unsigned int i;
+	const struct tst_tag *tags = tst_test->tags;
+
+	printf("\nTags\n");
+	printf("----\n\n");

And here:

	printf("----\n");

Otherwise LGTM.

Kind regards,
Petr

#3 lore raw

PATCH v2 1/2 lib: Add support for test tags

Hi!

Quoted 20 lines

lib/tst_test.c static void print_help(void) · line 421

Quoted 2 lines
lib/tst_test.c +2 -0
+	fprintf(stderr, "Options\n");
+	fprintf(stderr, "-------\n\n");

I still would remove this extra new line:

	fprintf(stderr, "-------\n");
Quoted 5 lines
lib/tst_test.c +1 -0
+
 	for (i = 0; i < ARRAY_SIZE(options); i++)
 		fprintf(stderr, "%s\n", options[i].help);

lib/tst_test.c static void print_help(void) · line 439

Quoted 10 lines
lib/tst_test.c +7 -0
@@ -424,6 +430,28 @@ static void print_help(void)
 		fprintf(stderr, "%s\n", tst_test->options[i].help);
 }
 
+static void print_test_tags(void)
+{
+	unsigned int i;
+	const struct tst_tag *tags = tst_test->tags;
+
+	printf("\nTags\n");
+	printf("----\n\n");

And here:

Quoted 1 line
	printf("----\n");

Changed as you suggested and pushed whole patchset, many thanks for reviews.

Signature · 2 lines
Cyril Hrubis
[email protected]
#4 lore raw

PATCH v2 1/2 lib: Add support for test tags

In reply to Cyril Hrubis

Cyril Hrubis <[email protected]> wrote:

...

Quoted 18 lines
lib/tst_test.c +16 -0
+static void print_failure_hints(void)
+{
+       unsigned int i;
+       const struct tst_tag *tags = tst_test->tags;
+
+       if (!tags)
+               return;
+
+       int hint_printed = 0;
+       for (i = 0; tags[i].name; i++) {
+               if (!strcmp(tags[i].name, "linux-git")) {
+                       if (!hint_printed) {
+                               hint_printed = 1;
+                               printf("\n");
+                               print_colored("HINT: ");
+                               printf("You _MAY_ be missing kernel fixes,

see:\n\n");

lib/tst_test.c int tst_parse_float(const char *str, float *val, float min, float max) · line 649

Quoted 10 lines
lib/tst_test.c +10 -0
+                       }
+
+                       printf(LINUX_GIT_URL "%s\n", tags[i].value);
+               }
+
+       }
+
+       hint_printed = 0;
+       for (i = 0; tags[i].name; i++) {
+               if (!strcmp(tags[i].name, "CVE")) {

Maybe we can merge this string compare in the same for loops?

e.g: http://pastebin.test.redhat.com/808028

Signature · 5 lines
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20191023/fd388af2/attachment-0001.htm>
#6 lore raw

PATCH v2 1/2 lib: Add support for test tags

Quoted 8 lines · Jan Stancek

----- Original Message -----

Quoted 3 lines

Maybe we can merge this string compare in the same for loops?

e.g: http://pastebin.test.redhat.com/808028

Li, I don't think this is public server.

Sorry, thanks for the reminder.
[I copied the below code to gmail, it always lost the indent]

static void print_failure_hints(void)

{
        unsigned int i;
        int hint_printed = 0;
        const struct tst_tag *tags = tst_test->tags;

        if (!tags)
                return;

        for (i = 0; tags[i].name; i++) {
                if (!strcmp(tags[i].name, "linux-git")) {
                        if (hint_printed != 1) {
                                hint_printed = 1;
                                print_colored("\nHINT: ");
                                printf("You _MAY_ be missing kernel fixes,
see:\n\n");
                        }

                        printf(LINUX_GIT_URL "%s\n", tags[i].value);
                } else if (!strcmp(tags[i].name, "CVE")) {
                         if (hint_printed != 2) {
                                 hint_printed = 2;
                                 print_colored("\nHINT: ");
                                 printf("You _MAY_ be vunerable to CVE(s),
see:\n\n");
                          }

                        printf(CVE_DB_URL "%s\n", tags[i].value);
                } else {
                        print_colored("\nERROR: ");
                        printf("tags[%d].name should be linux-git or
CVE\n", i);
                        return;
                }
        }
}
Signature · 5 lines
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20191023/617b683e/attachment.htm>
#7 lore raw

PATCH v2 1/2 lib: Add support for test tags

Hi!

Quoted 23 lines

Sorry, thanks for the reminder.
[I copied the below code to gmail, it always lost the indent]

static void print_failure_hints(void)

{
        unsigned int i;
        int hint_printed = 0;
        const struct tst_tag *tags = tst_test->tags;

        if (!tags)
                return;

        for (i = 0; tags[i].name; i++) {
                if (!strcmp(tags[i].name, "linux-git")) {
                        if (hint_printed != 1) {
                                hint_printed = 1;
                                print_colored("\nHINT: ");
                                printf("You _MAY_ be missing kernel fixes,
see:\n\n");
                        }

                        printf(LINUX_GIT_URL "%s\n", tags[i].value);
                } else if (!strcmp(tags[i].name, "CVE")) {
Quoted 8 lines
                         if (hint_printed != 2) {
                                 hint_printed = 2;
                                 print_colored("\nHINT: ");
                                 printf("You _MAY_ be vunerable to CVE(s),
see:\n\n");
                          }

                        printf(CVE_DB_URL "%s\n", tags[i].value);

This would produce intermixed CVE and linux-git lines unless the tags are sorted correctly in the source code, I do not want to depend on the order hence the two loops.

Quoted 5 lines
                } else {
                        print_colored("\nERROR: ");
                        printf("tags[%d].name should be linux-git or
CVE\n", i);
                        return;

I've tried to explain to pvorel already that this is a wrong place to assert the tag names. If nothing else this piece of code will be rarely triggered and the error would end up ignored.

I plan to assert the tag names in the docparse tool that will build the test metadata during the LTP build, so that wrong metadata will actually fail the LTP build.

Quoted 3 lines
                }
        }
}
Signature · 2 lines
Cyril Hrubis
[email protected]
#8 lore raw

PATCH v2 1/2 lib: Add support for test tags

Quoted 30 lines · Cyril Hrubis

Hi!

Quoted 4 lines

Sorry, thanks for the reminder.
[I copied the below code to gmail, it always lost the indent]

static void print_failure_hints(void)

Quoted 14 lines
{
        unsigned int i;
        int hint_printed = 0;
        const struct tst_tag *tags = tst_test->tags;

        if (!tags)
                return;

        for (i = 0; tags[i].name; i++) {
                if (!strcmp(tags[i].name, "linux-git")) {
                        if (hint_printed != 1) {
                                hint_printed = 1;
                                print_colored("\nHINT: ");
                                printf("You _MAY_ be missing kernel

fixes,

Quoted 9 lines
see:\n\n");
                        }

                        printf(LINUX_GIT_URL "%s\n", tags[i].value);
                } else if (!strcmp(tags[i].name, "CVE")) {
                         if (hint_printed != 2) {
                                 hint_printed = 2;
                                 print_colored("\nHINT: ");
                                 printf("You _MAY_ be vunerable to

CVE(s),

Quoted 9 lines
Quoted 4 lines
see:\n\n");
                          }

                        printf(CVE_DB_URL "%s\n", tags[i].value);

This would produce intermixed CVE and linux-git lines unless the tags are sorted correctly in the source code, I do not want to depend on the order hence the two loops.

Yes. But personally I suggest the tags sorted in order. I'm OK with two loops, it depends on you.

Quoted 11 lines
Quoted 6 lines
                } else {
                        print_colored("\nERROR: ");
                        printf("tags[%d].name should be linux-git or
CVE\n", i);
                        return;

I've tried to explain to pvorel already that this is a wrong place to assert the tag names. If nothing else this piece of code will be rarely triggered and the error would end up ignored.

Agree, it seems like too late to see this error in a test fails.

Quoted 5 lines

I plan to assert the tag names in the docparse tool that will build the test metadata during the LTP build, so that wrong metadata will actually fail the LTP build.

Cool~ That sounds better.

Signature · 5 lines
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20191024/bb52de50/attachment-0001.htm>
#9 lore raw

PATCH v2 2/2 testcases/kernel: Add linux git and CVE tags

In reply to Cyril Hrubis

Not all tests are annotated at the moment but the majority has been finished for now.

---
 testcases/cve/cve-2014-0196.c                         | 5 +++++
 testcases/cve/cve-2015-3290.c                         | 5 +++++
 testcases/cve/cve-2016-10044.c                        | 5 +++++
 testcases/cve/cve-2016-7042.c                         | 5 +++++
 testcases/cve/cve-2016-7117.c                         | 5 +++++
 testcases/cve/cve-2017-16939.c                        | 5 +++++
 testcases/cve/cve-2017-17052.c                        | 5 +++++
 testcases/cve/cve-2017-17053.c                        | 5 +++++
 testcases/cve/cve-2017-2618.c                         | 5 +++++
 testcases/cve/cve-2017-2671.c                         | 5 +++++
 testcases/cve/meltdown.c                              | 6 +++++-
 testcases/cve/stack_clash.c                           | 4 ++++
 testcases/kernel/crypto/af_alg01.c                    | 5 +++++
 testcases/kernel/crypto/af_alg02.c                    | 5 +++++
 testcases/kernel/crypto/af_alg03.c                    | 4 ++++
 testcases/kernel/crypto/af_alg04.c                    | 4 ++++
 testcases/kernel/crypto/af_alg05.c                    | 8 +++++++-
 testcases/kernel/crypto/af_alg06.c                    | 4 ++++
 testcases/kernel/crypto/crypto_user01.c               | 6 ++++++
 testcases/kernel/crypto/crypto_user02.c               | 4 ++++
 testcases/kernel/crypto/pcrypt_aead01.c               | 5 +++++
 testcases/kernel/sound/snd_timer01.c                  | 6 ++++++
 testcases/kernel/syscalls/accept/accept02.c           | 5 +++++
 testcases/kernel/syscalls/acct/acct02.c               | 4 ++++
 testcases/kernel/syscalls/add_key/add_key02.c         | 5 +++++
 testcases/kernel/syscalls/bpf/bpf_prog02.c            | 4 ++++
 testcases/kernel/syscalls/bpf/bpf_prog03.c            | 5 +++++
 testcases/kernel/syscalls/futex/futex_cmp_requeue02.c | 5 +++++
 testcases/kernel/syscalls/keyctl/keyctl02.c           | 4 ++++
 testcases/kernel/syscalls/keyctl/keyctl04.c           | 5 +++++
 testcases/kernel/syscalls/keyctl/keyctl05.c           | 4 ++++
 testcases/kernel/syscalls/move_pages/move_pages12.c   | 6 ++++++
 testcases/kernel/syscalls/realpath/realpath01.c       | 4 ++++
 testcases/kernel/syscalls/request_key/request_key05.c | 4 ++++
 testcases/kernel/syscalls/sbrk/sbrk03.c               | 4 ++++
 testcases/kernel/syscalls/sendto/sendto02.c           | 4 ++++
 testcases/kernel/syscalls/setrlimit/setrlimit06.c     | 4 ++++
 37 files changed, 176 insertions(+), 2 deletions(-)
testcases/cve/cve-2014-0196.c +5 -0
index 6997fffe4..012cbb7cd 100644
@@ -141,4 +141,9 @@ static struct tst_test test = {
 	.setup = setup,
 	.cleanup = cleanup,
 	.test_all = run,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "4291086b1f08"},
+		{"CVE", "2014-0196"},
+		{}
+	}
 };
testcases/cve/cve-2015-3290.c +5 -0
index fe630e4af..6c4fd57ac 100644
@@ -469,6 +469,11 @@ static struct tst_test test = {
 	.setup = setup,
 	.timeout = TIMEOUT,
 	.test_all = run,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "9b6e6a8334d5"},
+		{"CVE", "2015-3290"},
+		{}
+	}
 };
 
 #else /* HAVE_PERF_EVENT_ATTR && (defined(__x86_64__) || defined(__i386__)) */
testcases/cve/cve-2016-10044.c +5 -0
index c2e79df31..7519676a1 100644
@@ -62,4 +62,9 @@ static struct tst_test test = {
 	.test_all = run,
 	.cleanup = cleanup,
 	.min_kver = "2.6.8",
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "22f6b4d34fcf"},
+		{"CVE", "2016-10044"},
+		{}
+	}
 };
testcases/cve/cve-2016-7042.c +5 -0
index 35950adc7..4434265dd 100644
@@ -71,4 +71,9 @@ static struct tst_test test = {
 	.setup = setup,
 	.cleanup = cleanup,
 	.test_all = do_test,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "03dab869b7b2"},
+		{"CVE", "2016-7042"},
+		{}
+	}
 };
testcases/cve/cve-2016-7117.c +5 -0
index 5d9f842aa..dca002924 100644
@@ -150,4 +150,9 @@ static struct tst_test test = {
 	.setup = setup,
 	.cleanup = cleanup,
 	.min_kver = "2.6.33",
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "a2e2725541fa"},
+		{"CVE", "2016-7117"},
+		{}
+	}
 };
testcases/cve/cve-2017-16939.c +5 -0
index 4ecc86337..9ab1eb2c3 100644
@@ -77,4 +77,9 @@ static void run(void)
 static struct tst_test test = {
 	.setup = setup,
 	.test_all = run,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "1137b5e2529a"},
+		{"CVE", "2017-16939"},
+		{}
+	}
 };
testcases/cve/cve-2017-17052.c +5 -0
index 81123fce8..d89c62eb6 100644
@@ -111,4 +111,9 @@ static struct tst_test test = {
 	.cleanup = cleanup,
 	.setup = setup,
 	.test_all = run,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "2b7e8665b4ff"},
+		{"CVE", "2017-17052"},
+		{}
+	}
 };
testcases/cve/cve-2017-17053.c +5 -0
index 646ec11cc..08a08211d 100644
@@ -154,6 +154,11 @@ static struct tst_test test = {
 	.setup = setup,
 	.cleanup = cleanup,
 	.test_all = run,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "ccd5b3235180"},
+		{"CVE", "2017-17053"},
+		{}
+	}
 };
 
 #else
testcases/cve/cve-2017-2618.c +5 -0
index cf018d401..4ab3cfb8f 100644
@@ -51,4 +51,9 @@ static struct tst_test test = {
 	.forks_child = 1,
 	.setup = setup,
 	.test_all = do_test,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "0c461cb727d1"},
+		{"CVE", "2017-2618"},
+		{}
+	}
 };
testcases/cve/cve-2017-2671.c +5 -0
index b92c1d94b..e72795d15 100644
@@ -109,4 +109,9 @@ static struct tst_test test = {
 	.test_all = run,
 	.cleanup = cleanup,
 	.needs_root = 1,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "43a6684519ab"},
+		{"CVE", "2017-2671"},
+		{}
+	}
 };
testcases/cve/meltdown.c +5 -1
index 863f1a9e4..db00e1811 100644
@@ -377,7 +377,11 @@ static struct tst_test test = {
 	.setup = setup,
 	.test_all = run,
 	.cleanup = cleanup,
-	.min_kver = "2.6.32"
+	.min_kver = "2.6.32",
+	.tags = (const struct tst_tag[]) {
+		{"CVE", "2017-5754"},
+		{}
+	}
 };
 
 #else /* #if defined(__x86_64__) || defined(__i386__) */
testcases/cve/stack_clash.c +4 -0
index 3ea3ec491..ecbf5f6da 100644
@@ -250,4 +250,8 @@ static struct tst_test test = {
 	.needs_root = 1,
 	.setup = setup,
 	.test_all = stack_clash_test,
+	.tags = (const struct tst_tag[]) {
+		{"CVE", "2017-1000364"},
+		{}
+	}
 };
testcases/kernel/crypto/af_alg01.c +5 -0
index bb6e01738..d3e823e6c 100644
@@ -76,4 +76,9 @@ static void do_test(unsigned int i)
 static struct tst_test test = {
 	.test = do_test,
 	.tcnt = ARRAY_SIZE(hash_algs),
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "af3ff8045bbf"},
+		{"CVE", "2017-17806"},
+		{}
+	}
 };
testcases/kernel/crypto/af_alg02.c +5 -0
index 08087ecac..fab0010c9 100644
@@ -59,4 +59,9 @@ static struct tst_test test = {
 	.test_all = run,
 	.timeout = 20,
 	.needs_checkpoints = 1,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "ecaaab564978"},
+		{"CVE", "2017-17805"},
+		{}
+	}
 };
testcases/kernel/crypto/af_alg03.c +4 -0
index 240c52835..5f214e48b 100644
@@ -28,4 +28,8 @@ static void run(void)
 
 static struct tst_test test = {
 	.test_all = run,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "e57121d08c38"},
+		{}
+	}
 };
testcases/kernel/crypto/af_alg04.c +4 -0
index 48239e020..df049048a 100644
@@ -55,4 +55,8 @@ static void run(void)
 static struct tst_test test = {
 	.test_all = run,
 	.forks_child = 1,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "bb2964810233"},
+		{}
+	}
 };
testcases/kernel/crypto/af_alg05.c +7 -1
index 964adffcc..df2b03546 100644
@@ -11,7 +11,7 @@
  * boundary.  Based on the reproducer from the commit message.  Note that this
  * issue only reproduces on certain architectures, such as arm and arm64.
  *
- * On some older kernel without commit 160544075f2 ("crypto: scatterwalk - Hide
+ * On some older kernel without commit 160544075f2a ("crypto: scatterwalk - Hide
  * PageSlab call to optimise away flush_dcache_page") , it doesn't use
  * ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE macro. It can crash on all architectures.
  * Without skcipher walk interface, it is also a regresstion test for commit
@@ -46,4 +46,10 @@ static void run(void)
 
 static struct tst_test test = {
 	.test_all = run,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "8088d3dd4d7c"},
+		{"linux-git", "160544075f2a"},
+		{"linux-git", "0868def3e410"},
+		{}
+	}
 };
testcases/kernel/crypto/af_alg06.c +4 -0
index 586d91b1d..6acdf8532 100644
@@ -48,4 +48,8 @@ static void run(void)
 
 static struct tst_test test = {
 	.test_all = run,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "8f9c46934848"},
+		{}
+	}
 };
testcases/kernel/crypto/crypto_user01.c +6 -0
index 163d7a2dd..47bf9f0d2 100644
@@ -192,4 +192,10 @@ static struct tst_test test = {
 	.setup = setup,
 	.test_all = run,
 	.cleanup = cleanup,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "f43f39958beb"},
+		{"CVE", "2013-2547"},
+		{"CVE", "2018-19854"},
+		{}
+	}
 };
testcases/kernel/crypto/crypto_user02.c +4 -0
index 6090b5a4e..384e344f2 100644
@@ -105,4 +105,8 @@ static struct tst_test test = {
 	.cleanup = cleanup,
 	.needs_root = 1,
 	.forks_child = 1,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "21d4120ec6f5"},
+		{}
+	}
 };
testcases/kernel/crypto/pcrypt_aead01.c +5 -0
index 3dc8c58c2..0609af9f6 100644
@@ -75,4 +75,9 @@ static struct tst_test test = {
 	.test_all = run,
 	.cleanup = cleanup,
 	.needs_root = 1,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "d76c68109f37"},
+		{"CVE", "2017-5754"},
+		{}
+	}
 };
testcases/kernel/sound/snd_timer01.c +6 -0
index f62696659..e339ec862 100644
@@ -140,4 +140,10 @@ static struct tst_test test = {
 	.test_all = run,
 	.setup = setup,
 	.cleanup = cleanup,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "d11662f4f798"},
+		{"linux-git", "ba3021b2c79b"},
+		{"CVE", "2017-1000380"},
+		{}
+	}
 };
testcases/kernel/syscalls/accept/accept02.c +5 -0
index 1a0f625c9..37ab8b64f 100644
@@ -142,4 +142,9 @@ static struct tst_test test = {
 	.setup = setup,
 	.cleanup = cleanup,
 	.needs_checkpoints = 1,
+	.tags = (const struct tst_tag[]) {
+		{"CVE", "2017-8890"},
+		{"linux-git", "657831ff"},
+		{},
+	}
 };
testcases/kernel/syscalls/acct/acct02.c +4 -0
index 4d95aafec..890568b08 100644
@@ -263,4 +263,8 @@ static struct tst_test test = {
 	.cleanup = cleanup,
 	.needs_tmpdir = 1,
 	.needs_root = 1,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "4d9570158b626"},
+		{}
+	}
 };
testcases/kernel/syscalls/add_key/add_key02.c +5 -0
index 4a5cf054a..159234f67 100644
@@ -83,4 +83,9 @@ static void verify_add_key(unsigned int i)
 static struct tst_test test = {
 	.tcnt = ARRAY_SIZE(tcases),
 	.test = verify_add_key,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "5649645d725c"},
+		{"CVE", "2017-15274"},
+		{}
+	}
 };
testcases/kernel/syscalls/bpf/bpf_prog02.c +4 -0
index 62e02bc9f..acff1884a 100644
@@ -181,5 +181,9 @@ static struct tst_test test = {
 		{&attr, .size = sizeof(*attr)},
 		{&msg, .size = sizeof(MSG)},
 		{},
+	},
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "3612af783cf5"},
+		{}
 	}
 };
testcases/kernel/syscalls/bpf/bpf_prog03.c +5 -0
index 47088a250..d79815961 100644
@@ -187,5 +187,10 @@ static struct tst_test test = {
 		{&attr, .size = sizeof(*attr)},
 		{&msg, .size = sizeof(MSG)},
 		{},
+	},
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "95a762e2c8c9"},
+		{"CVE", "2017-16995"},
+		{}
 	}
 };
testcases/kernel/syscalls/futex/futex_cmp_requeue02.c +5 -0
index 3ea19428c..228d8cff6 100644
@@ -73,4 +73,9 @@ static struct tst_test test = {
 	.cleanup = cleanup,
 	.test = verify_futex_cmp_requeue,
 	.tcnt = ARRAY_SIZE(tcases),
+	.tags = (const struct tst_tag[]) {
+		{"CVE", "2018-6927"},
+		{"linux-git", "fbe0e839d1e2"},
+		{}
+	}
 };
testcases/kernel/syscalls/keyctl/keyctl02.c +4 -0
index b034275d2..f4ee03f33 100644
@@ -136,4 +136,8 @@ static struct tst_test test = {
 	.setup = setup,
 	.cleanup = cleanup,
 	.test_all = do_test,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "b4a1b4f5047e"},
+		{}
+	}
 };
testcases/kernel/syscalls/keyctl/keyctl04.c +5 -0
index d30d25b04..1fed23ca6 100644
@@ -43,4 +43,9 @@ static void do_test(void)
 
 static struct tst_test test = {
 	.test_all = do_test,
+	.tags = (const struct tst_tag[]) {
+		{"CVE", "2017-7472"},
+		{"linux-git", "c9f838d104fe"},
+		{}
+	}
 };
testcases/kernel/syscalls/keyctl/keyctl05.c +4 -0
index 653b838f5..c592eb49e 100644
@@ -207,4 +207,8 @@ static struct tst_test test = {
 	.tcnt = 3,
 	.test = do_test,
 	.forks_child = 1,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "63a0b0509e70"},
+		{}
+	}
 };
testcases/kernel/syscalls/move_pages/move_pages12.c +6 -0
index c2927fb86..c906acbe3 100644
@@ -330,6 +330,12 @@ static struct tst_test test = {
 	.cleanup = cleanup,
 	.test = do_test,
 	.tcnt = ARRAY_SIZE(tcases),
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "e66f17ff7177"},
+		{"linux-git", "c9d398fa2378"},
+		{"linux-git", "4643d67e8cb0"},
+		{}
+	}
 };
 
 #else
testcases/kernel/syscalls/realpath/realpath01.c +4 -0
index fc2af2a1c..c0381e9cb 100644
@@ -41,4 +41,8 @@ static struct tst_test test = {
 	.setup = setup,
 	.needs_root = 1,
 	.needs_tmpdir = 1,
+	.tags = (const struct tst_tag[]) {
+		{"CVE", "2018-1000001"},
+		{}
+	}
 };
testcases/kernel/syscalls/request_key/request_key05.c +4 -0
index 129cc0507..a17d1d058 100644
@@ -31,4 +31,8 @@ static void run(void)
 
 static struct tst_test test = {
 	.test_all = run,
+	.tags = (const struct tst_tag[]) {
+		{"CVE", "2017-6951"},
+		{}
+	}
 };
testcases/kernel/syscalls/sbrk/sbrk03.c +4 -0
index 761a01c9d..80d2020ff 100644
@@ -66,4 +66,8 @@ static void sbrk_test(void)
 
 static struct tst_test test = {
 	.test_all = sbrk_test,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "473a06572fcd"},
+		{}
+	}
 };
testcases/kernel/syscalls/sendto/sendto02.c +4 -0
index 5c9f00125..743101733 100644
@@ -77,4 +77,8 @@ static struct tst_test test = {
 	.setup = setup,
 	.cleanup = cleanup,
 	.test_all = verify_sendto,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "6e51fe757259"},
+		{}
+	}
 };
testcases/kernel/syscalls/setrlimit/setrlimit06.c +4 -0
index 87e6b0e32..726b26841 100644
@@ -114,4 +114,8 @@ static struct tst_test test = {
 	.setup = setup,
 	.cleanup = cleanup,
 	.forks_child = 1,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "c3bca5d450b62"},
+		{}
+	}
 };
Signature · 1 line
2.21.0
#10 lore raw

PATCH v2 2/2 testcases/kernel: Add linux git and CVE tags

Quoted 6 lines · Cyril Hrubis

Not all tests are annotated at the moment but the majority has been finished for now.

Signature · 5 lines
Regards,
Li Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20191023/e3032fd4/attachment.htm>