[LTP] [PATCH v3 2/2] Add test for CVE 2021-38198

Petr Vorel pvorel@suse.cz
Mon May 6 21:17:39 CEST 2024


Hi Martin, Cyril,

> --- /dev/null
> +++ b/testcases/kernel/kvm/kvm_pagefault01.c
...
> +static void setup(void)
> +{
> +	disable_tdp();
> +	tst_kvm_setup();
> +}
> +
> +static struct tst_test test = {
> +	.test_all = tst_kvm_run,
> +	.setup = setup,
> +	.cleanup = tst_kvm_cleanup,
> +	.needs_root = 1,

This test was merged some time ago.

FYI this .needs_root generates -Wsingle-bit-bitfield-constant-conversion error.
Nothing important, maybe you see an easy way to fix it.

kvm_pagefault01.c:218:16: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
        .needs_root = 1,
                      ^
1 warning generated.

Kind regards,
Petr

> +	.save_restore = (const struct tst_path_val[]) {
> +		{"?/sys/module/kvm/parameters/tdp_mmu", "0"},
> +		{}
> +	},
> +	.supported_archs = (const char *const []) {
> +		"x86_64",
> +		NULL
> +	},
> +	.tags = (struct tst_tag[]){
> +		{"linux-git", "b1bd5cba3306"},
> +		{"CVE", "2021-38198"},
> +		{}
> +	}
> +};
> +
> +#endif /* COMPILE_PAYLOAD */


More information about the ltp mailing list