* [LTP] [PATCH v2] cve: Fix kernel symbol finding for meltdown case
@ 2019-08-21 8:27 zhe.he
2019-08-21 16:01 ` Jan Stancek
0 siblings, 1 reply; 3+ messages in thread
From: zhe.he @ 2019-08-21 8:27 UTC (permalink / raw)
To: ltp
From: He Zhe <zhe.he@windriver.com>
meltdown case fails as below.
safe_file_ops.c:219: BROK: Expected 3 conversions got 2 at meltdown.c:272
find_kernel_symbol is defined to try twice with each of /proc/kallsyms and
/boot/System.map-%s. Currently if the symbol is not found in /proc/kallsyms,
when kernel option CONFIG_KALLSYMS_ALL is disabled, it would stop the case
immediately due to SAFE_FILE_LINES_SCANF.
This patch turns to use FILE_LINES_SCANF to give find_kernel_symbol second
chance.
Signed-off-by: He Zhe <zhe.he@windriver.com>
---
testcases/cve/meltdown.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testcases/cve/meltdown.c b/testcases/cve/meltdown.c
index f78c38b..2d66c1e 100644
--- a/testcases/cve/meltdown.c
+++ b/testcases/cve/meltdown.c
@@ -255,7 +255,7 @@ find_symbol_in_file(const char *filename, const char *symname)
sprintf(fmt, "%%lx %%c %s%%c", symname);
- ret = SAFE_FILE_LINES_SCANF(filename, fmt, &addr, &type, &read);
+ ret = FILE_LINES_SCANF(filename, fmt, &addr, &type, &read);
if (ret)
return 0;
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [LTP] [PATCH v2] cve: Fix kernel symbol finding for meltdown case
2019-08-21 8:27 [LTP] [PATCH v2] cve: Fix kernel symbol finding for meltdown case zhe.he
@ 2019-08-21 16:01 ` Jan Stancek
2019-08-22 12:37 ` Jan Stancek
0 siblings, 1 reply; 3+ messages in thread
From: Jan Stancek @ 2019-08-21 16:01 UTC (permalink / raw)
To: ltp
----- Original Message -----
> From: He Zhe <zhe.he@windriver.com>
>
> meltdown case fails as below.
> safe_file_ops.c:219: BROK: Expected 3 conversions got 2 at meltdown.c:272
>
> find_kernel_symbol is defined to try twice with each of /proc/kallsyms and
> /boot/System.map-%s. Currently if the symbol is not found in /proc/kallsyms,
> when kernel option CONFIG_KALLSYMS_ALL is disabled, it would stop the case
> immediately due to SAFE_FILE_LINES_SCANF.
>
> This patch turns to use FILE_LINES_SCANF to give find_kernel_symbol second
> chance.
That explains it, thanks for the patch.
We should also tweak TCONF condition in find_kernel_symbol - no need
to re-post for that, I can add that.
>
> Signed-off-by: He Zhe <zhe.he@windriver.com>
> ---
> testcases/cve/meltdown.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/testcases/cve/meltdown.c b/testcases/cve/meltdown.c
> index f78c38b..2d66c1e 100644
> --- a/testcases/cve/meltdown.c
> +++ b/testcases/cve/meltdown.c
> @@ -255,7 +255,7 @@ find_symbol_in_file(const char *filename, const char
> *symname)
>
> sprintf(fmt, "%%lx %%c %s%%c", symname);
>
> - ret = SAFE_FILE_LINES_SCANF(filename, fmt, &addr, &type, &read);
> + ret = FILE_LINES_SCANF(filename, fmt, &addr, &type, &read);
> if (ret)
> return 0;
>
> --
> 2.7.4
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [LTP] [PATCH v2] cve: Fix kernel symbol finding for meltdown case
2019-08-21 16:01 ` Jan Stancek
@ 2019-08-22 12:37 ` Jan Stancek
0 siblings, 0 replies; 3+ messages in thread
From: Jan Stancek @ 2019-08-22 12:37 UTC (permalink / raw)
To: ltp
----- Original Message -----
>
>
> ----- Original Message -----
> > From: He Zhe <zhe.he@windriver.com>
> >
> > meltdown case fails as below.
> > safe_file_ops.c:219: BROK: Expected 3 conversions got 2 at meltdown.c:272
> >
> > find_kernel_symbol is defined to try twice with each of /proc/kallsyms and
> > /boot/System.map-%s. Currently if the symbol is not found in
> > /proc/kallsyms,
> > when kernel option CONFIG_KALLSYMS_ALL is disabled, it would stop the case
> > immediately due to SAFE_FILE_LINES_SCANF.
> >
> > This patch turns to use FILE_LINES_SCANF to give find_kernel_symbol second
> > chance.
>
> That explains it, thanks for the patch.
>
> We should also tweak TCONF condition in find_kernel_symbol - no need
> to re-post for that, I can add that.
Pushed, also with tweak for commit 7709d2ae92ea, so we try System.map,
even if kallsyms are completely disabled.
Regards,
Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-08-22 12:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-21 8:27 [LTP] [PATCH v2] cve: Fix kernel symbol finding for meltdown case zhe.he
2019-08-21 16:01 ` Jan Stancek
2019-08-22 12:37 ` Jan Stancek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox