* [LTP] [PATCH] syscalls/getrandom05: use tst_syscall
@ 2024-12-04 14:18 Jan Stancek
2024-12-05 1:48 ` Li Wang
2024-12-06 10:36 ` Cyril Hrubis
0 siblings, 2 replies; 8+ messages in thread
From: Jan Stancek @ 2024-12-04 14:18 UTC (permalink / raw)
To: ltp; +Cc: liwan
With glibc-2.40 and recent kernel (6.12) the test uses
vdso implementation which runs into SIGSEGV for EFAULT test:
#0 __arch_chacha20_blocks_nostack () at arch/x86/entry/vdso/vgetrandom-chacha.S:146
146 movups state0,0x00(output)
(gdb) bt
#0 __arch_chacha20_blocks_nostack () at arch/x86/entry/vdso/vgetrandom-chacha.S:146
#1 0x00007fcd3ce6417a in __cvdso_getrandom_data (rng_info=0x7fcd3ce5f280, buffer=0xffffffffffffffff, len=64, flags=1, opaque_state=0x7fcd3ce5df00,
opaque_len=<optimized out>) at arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:237
#2 __cvdso_getrandom (buffer=<optimized out>, len=64, flags=1, opaque_state=0x7fcd3ce5df00, opaque_len=<optimized out>)
at arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:259
#3 __vdso_getrandom (buffer=0xffffffffffffffff, len=64, flags=1, opaque_state=0x7fcd3ce5df00, opaque_len=<optimized out>)
at arch/x86/entry/vdso/vgetrandom.c:11
#4 0x00007fcd3cc7faf3 in getrandom_vdso (buffer=0xffffffffffffffff, length=64, flags=0, cancel=<optimized out>)
at ../sysdeps/unix/sysv/linux/getrandom.c:204
#5 0x0000000000401ff7 in verify_getrandom (i=0) at getrandom05.c:40
Change the test to use syscall implementation of getrandom().
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
testcases/kernel/syscalls/getrandom/getrandom05.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/getrandom/getrandom05.c b/testcases/kernel/syscalls/getrandom/getrandom05.c
index 92098deb723d..8f7ce45785c5 100644
--- a/testcases/kernel/syscalls/getrandom/getrandom05.c
+++ b/testcases/kernel/syscalls/getrandom/getrandom05.c
@@ -16,6 +16,7 @@
#include "tst_test.h"
#include "lapi/getrandom.h"
+#include "lapi/syscalls.h"
static char buff_efault[64];
static char buff_einval[64];
@@ -36,7 +37,7 @@ static void verify_getrandom(unsigned int i)
{
struct test_case_t *tc = &tcases[i];
- TST_EXP_FAIL2(getrandom(tc->buff, tc->size, tc->flag),
+ TST_EXP_FAIL2(tst_syscall(__NR_getrandom, tc->buff, tc->size, tc->flag),
tc->expected_errno, "%s", tc->desc);
}
--
2.43.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH] syscalls/getrandom05: use tst_syscall
2024-12-04 14:18 [LTP] [PATCH] syscalls/getrandom05: use tst_syscall Jan Stancek
@ 2024-12-05 1:48 ` Li Wang
2024-12-06 10:36 ` Cyril Hrubis
1 sibling, 0 replies; 8+ messages in thread
From: Li Wang @ 2024-12-05 1:48 UTC (permalink / raw)
To: Jan Stancek; +Cc: ltp
On Wed, Dec 4, 2024 at 10:18 PM Jan Stancek <jstancek@redhat.com> wrote:
> With glibc-2.40 and recent kernel (6.12) the test uses
> vdso implementation which runs into SIGSEGV for EFAULT test:
>
> #0 __arch_chacha20_blocks_nostack () at
> arch/x86/entry/vdso/vgetrandom-chacha.S:146
> 146 movups state0,0x00(output)
>
> (gdb) bt
> #0 __arch_chacha20_blocks_nostack () at
> arch/x86/entry/vdso/vgetrandom-chacha.S:146
> #1 0x00007fcd3ce6417a in __cvdso_getrandom_data
> (rng_info=0x7fcd3ce5f280, buffer=0xffffffffffffffff, len=64, flags=1,
> opaque_state=0x7fcd3ce5df00,
> opaque_len=<optimized out>) at
> arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:237
> #2 __cvdso_getrandom (buffer=<optimized out>, len=64, flags=1,
> opaque_state=0x7fcd3ce5df00, opaque_len=<optimized out>)
> at arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:259
> #3 __vdso_getrandom (buffer=0xffffffffffffffff, len=64, flags=1,
> opaque_state=0x7fcd3ce5df00, opaque_len=<optimized out>)
> at arch/x86/entry/vdso/vgetrandom.c:11
> #4 0x00007fcd3cc7faf3 in getrandom_vdso (buffer=0xffffffffffffffff,
> length=64, flags=0, cancel=<optimized out>)
> at ../sysdeps/unix/sysv/linux/getrandom.c:204
> #5 0x0000000000401ff7 in verify_getrandom (i=0) at getrandom05.c:40
>
> Change the test to use syscall implementation of getrandom().
>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
>
Good catch!
Reviewed-by: Li Wang <liwang@redhat.com>
---
> testcases/kernel/syscalls/getrandom/getrandom05.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/syscalls/getrandom/getrandom05.c
> b/testcases/kernel/syscalls/getrandom/getrandom05.c
> index 92098deb723d..8f7ce45785c5 100644
> --- a/testcases/kernel/syscalls/getrandom/getrandom05.c
> +++ b/testcases/kernel/syscalls/getrandom/getrandom05.c
> @@ -16,6 +16,7 @@
>
> #include "tst_test.h"
> #include "lapi/getrandom.h"
> +#include "lapi/syscalls.h"
>
> static char buff_efault[64];
> static char buff_einval[64];
> @@ -36,7 +37,7 @@ static void verify_getrandom(unsigned int i)
> {
> struct test_case_t *tc = &tcases[i];
>
> - TST_EXP_FAIL2(getrandom(tc->buff, tc->size, tc->flag),
> + TST_EXP_FAIL2(tst_syscall(__NR_getrandom, tc->buff, tc->size,
> tc->flag),
> tc->expected_errno, "%s", tc->desc);
> }
>
> --
> 2.43.0
>
>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH] syscalls/getrandom05: use tst_syscall
2024-12-04 14:18 [LTP] [PATCH] syscalls/getrandom05: use tst_syscall Jan Stancek
2024-12-05 1:48 ` Li Wang
@ 2024-12-06 10:36 ` Cyril Hrubis
2024-12-06 10:55 ` Jan Stancek
2024-12-06 13:36 ` [LTP] [PATCH v2] syscalls/getrandom05: add test variants Jan Stancek
1 sibling, 2 replies; 8+ messages in thread
From: Cyril Hrubis @ 2024-12-06 10:36 UTC (permalink / raw)
To: Jan Stancek; +Cc: liwan, ltp
Hi!
> With glibc-2.40 and recent kernel (6.12) the test uses
> vdso implementation which runs into SIGSEGV for EFAULT test:
>
> #0 __arch_chacha20_blocks_nostack () at arch/x86/entry/vdso/vgetrandom-chacha.S:146
> 146 movups state0,0x00(output)
>
> (gdb) bt
> #0 __arch_chacha20_blocks_nostack () at arch/x86/entry/vdso/vgetrandom-chacha.S:146
> #1 0x00007fcd3ce6417a in __cvdso_getrandom_data (rng_info=0x7fcd3ce5f280, buffer=0xffffffffffffffff, len=64, flags=1, opaque_state=0x7fcd3ce5df00,
> opaque_len=<optimized out>) at arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:237
> #2 __cvdso_getrandom (buffer=<optimized out>, len=64, flags=1, opaque_state=0x7fcd3ce5df00, opaque_len=<optimized out>)
> at arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:259
> #3 __vdso_getrandom (buffer=0xffffffffffffffff, len=64, flags=1, opaque_state=0x7fcd3ce5df00, opaque_len=<optimized out>)
> at arch/x86/entry/vdso/vgetrandom.c:11
> #4 0x00007fcd3cc7faf3 in getrandom_vdso (buffer=0xffffffffffffffff, length=64, flags=0, cancel=<optimized out>)
> at ../sysdeps/unix/sysv/linux/getrandom.c:204
> #5 0x0000000000401ff7 in verify_getrandom (i=0) at getrandom05.c:40
>
> Change the test to use syscall implementation of getrandom().
>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
> testcases/kernel/syscalls/getrandom/getrandom05.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/syscalls/getrandom/getrandom05.c b/testcases/kernel/syscalls/getrandom/getrandom05.c
> index 92098deb723d..8f7ce45785c5 100644
> --- a/testcases/kernel/syscalls/getrandom/getrandom05.c
> +++ b/testcases/kernel/syscalls/getrandom/getrandom05.c
> @@ -16,6 +16,7 @@
>
> #include "tst_test.h"
> #include "lapi/getrandom.h"
> +#include "lapi/syscalls.h"
>
> static char buff_efault[64];
> static char buff_einval[64];
> @@ -36,7 +37,7 @@ static void verify_getrandom(unsigned int i)
> {
> struct test_case_t *tc = &tcases[i];
>
> - TST_EXP_FAIL2(getrandom(tc->buff, tc->size, tc->flag),
> + TST_EXP_FAIL2(tst_syscall(__NR_getrandom, tc->buff, tc->size, tc->flag),
> tc->expected_errno, "%s", tc->desc);
This means that we will not cover the EINVAL error for VDSO anymore.
Also the rest of the tests seems to use syscall only, which means that
we will not test the VDSO that is going to be used by default. I suppose
that we should add test variants to these testcases and run them both
for libc getrandom() and the syscall and just skip the EFAULT here on
glibc.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH] syscalls/getrandom05: use tst_syscall
2024-12-06 10:36 ` Cyril Hrubis
@ 2024-12-06 10:55 ` Jan Stancek
2024-12-06 13:36 ` [LTP] [PATCH v2] syscalls/getrandom05: add test variants Jan Stancek
1 sibling, 0 replies; 8+ messages in thread
From: Jan Stancek @ 2024-12-06 10:55 UTC (permalink / raw)
To: Cyril Hrubis; +Cc: liwan, ltp
On Fri, Dec 6, 2024 at 11:36 AM Cyril Hrubis <chrubis@suse.cz> wrote:
>
> Hi!
> > With glibc-2.40 and recent kernel (6.12) the test uses
> > vdso implementation which runs into SIGSEGV for EFAULT test:
> >
> > #0 __arch_chacha20_blocks_nostack () at arch/x86/entry/vdso/vgetrandom-chacha.S:146
> > 146 movups state0,0x00(output)
> >
> > (gdb) bt
> > #0 __arch_chacha20_blocks_nostack () at arch/x86/entry/vdso/vgetrandom-chacha.S:146
> > #1 0x00007fcd3ce6417a in __cvdso_getrandom_data (rng_info=0x7fcd3ce5f280, buffer=0xffffffffffffffff, len=64, flags=1, opaque_state=0x7fcd3ce5df00,
> > opaque_len=<optimized out>) at arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:237
> > #2 __cvdso_getrandom (buffer=<optimized out>, len=64, flags=1, opaque_state=0x7fcd3ce5df00, opaque_len=<optimized out>)
> > at arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:259
> > #3 __vdso_getrandom (buffer=0xffffffffffffffff, len=64, flags=1, opaque_state=0x7fcd3ce5df00, opaque_len=<optimized out>)
> > at arch/x86/entry/vdso/vgetrandom.c:11
> > #4 0x00007fcd3cc7faf3 in getrandom_vdso (buffer=0xffffffffffffffff, length=64, flags=0, cancel=<optimized out>)
> > at ../sysdeps/unix/sysv/linux/getrandom.c:204
> > #5 0x0000000000401ff7 in verify_getrandom (i=0) at getrandom05.c:40
> >
> > Change the test to use syscall implementation of getrandom().
> >
> > Signed-off-by: Jan Stancek <jstancek@redhat.com>
> > ---
> > testcases/kernel/syscalls/getrandom/getrandom05.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/testcases/kernel/syscalls/getrandom/getrandom05.c b/testcases/kernel/syscalls/getrandom/getrandom05.c
> > index 92098deb723d..8f7ce45785c5 100644
> > --- a/testcases/kernel/syscalls/getrandom/getrandom05.c
> > +++ b/testcases/kernel/syscalls/getrandom/getrandom05.c
> > @@ -16,6 +16,7 @@
> >
> > #include "tst_test.h"
> > #include "lapi/getrandom.h"
> > +#include "lapi/syscalls.h"
> >
> > static char buff_efault[64];
> > static char buff_einval[64];
> > @@ -36,7 +37,7 @@ static void verify_getrandom(unsigned int i)
> > {
> > struct test_case_t *tc = &tcases[i];
> >
> > - TST_EXP_FAIL2(getrandom(tc->buff, tc->size, tc->flag),
> > + TST_EXP_FAIL2(tst_syscall(__NR_getrandom, tc->buff, tc->size, tc->flag),
> > tc->expected_errno, "%s", tc->desc);
>
> This means that we will not cover the EINVAL error for VDSO anymore.
>
> Also the rest of the tests seems to use syscall only, which means that
> we will not test the VDSO that is going to be used by default. I suppose
> that we should add test variants to these testcases and run them both
> for libc getrandom() and the syscall and just skip the EFAULT here on
> glibc.
Yes, that would be preferable - just wanted to address this failure quickly.
I'll look at adding the variants to the test.
>
> --
> Cyril Hrubis
> chrubis@suse.cz
>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 8+ messages in thread
* [LTP] [PATCH v2] syscalls/getrandom05: add test variants
2024-12-06 10:36 ` Cyril Hrubis
2024-12-06 10:55 ` Jan Stancek
@ 2024-12-06 13:36 ` Jan Stancek
2024-12-06 14:34 ` Cyril Hrubis
2024-12-09 7:09 ` Li Wang
1 sibling, 2 replies; 8+ messages in thread
From: Jan Stancek @ 2024-12-06 13:36 UTC (permalink / raw)
To: ltp; +Cc: liwan
And skip EFAULT for glibc as it can segfault in VDSO:
#0 __arch_chacha20_blocks_nostack () at arch/x86/entry/vdso/vgetrandom-chacha.S:146
146 movups state0,0x00(output)
(gdb) bt
#0 __arch_chacha20_blocks_nostack () at arch/x86/entry/vdso/vgetrandom-chacha.S:146
#1 0x00007fcd3ce6417a in __cvdso_getrandom_data (rng_info=0x7fcd3ce5f280, buffer=0xffffffffffffffff, len=64, flags=1, opaque_state=0x7fcd3ce5df00,
opaque_len=<optimized out>) at arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:237
#2 __cvdso_getrandom (buffer=<optimized out>, len=64, flags=1, opaque_state=0x7fcd3ce5df00, opaque_len=<optimized out>)
at arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:259
#3 __vdso_getrandom (buffer=0xffffffffffffffff, len=64, flags=1, opaque_state=0x7fcd3ce5df00, opaque_len=<optimized out>)
at arch/x86/entry/vdso/vgetrandom.c:11
#4 0x00007fcd3cc7faf3 in getrandom_vdso (buffer=0xffffffffffffffff, length=64, flags=0, cancel=<optimized out>)
at ../sysdeps/unix/sysv/linux/getrandom.c:204
#5 0x0000000000401ff7 in verify_getrandom (i=0) at getrandom05.c:40
Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
.../kernel/syscalls/getrandom/getrandom05.c | 16 +++++++-
.../kernel/syscalls/getrandom/getrandom_var.h | 41 +++++++++++++++++++
2 files changed, 56 insertions(+), 1 deletion(-)
create mode 100644 testcases/kernel/syscalls/getrandom/getrandom_var.h
diff --git a/testcases/kernel/syscalls/getrandom/getrandom05.c b/testcases/kernel/syscalls/getrandom/getrandom05.c
index 92098deb723d..c4886b886f80 100644
--- a/testcases/kernel/syscalls/getrandom/getrandom05.c
+++ b/testcases/kernel/syscalls/getrandom/getrandom05.c
@@ -16,6 +16,7 @@
#include "tst_test.h"
#include "lapi/getrandom.h"
+#include "getrandom_var.h"
static char buff_efault[64];
static char buff_einval[64];
@@ -32,15 +33,28 @@ static struct test_case_t {
{buff_einval, sizeof(buff_einval), -1, EINVAL, "flag is invalid"},
};
+static void setup(void)
+{
+ getrandom_info();
+}
+
static void verify_getrandom(unsigned int i)
{
struct test_case_t *tc = &tcases[i];
- TST_EXP_FAIL2(getrandom(tc->buff, tc->size, tc->flag),
+ /* EFAULT test can segfault on recent glibc, skip it */
+ if (tst_variant == 1 && tc->expected_errno == EFAULT) {
+ tst_res(TCONF, "Skipping EFAULT test for libc getrandom()");
+ return;
+ }
+
+ TST_EXP_FAIL2(do_getrandom(tc->buff, tc->size, tc->flag),
tc->expected_errno, "%s", tc->desc);
}
static struct tst_test test = {
.tcnt = ARRAY_SIZE(tcases),
.test = verify_getrandom,
+ .test_variants = TEST_VARIANTS,
+ .setup = setup,
};
diff --git a/testcases/kernel/syscalls/getrandom/getrandom_var.h b/testcases/kernel/syscalls/getrandom/getrandom_var.h
new file mode 100644
index 000000000000..b19b0ebc0120
--- /dev/null
+++ b/testcases/kernel/syscalls/getrandom/getrandom_var.h
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) 2024 Jan Stancek <jstancek@redhat.com>
+ */
+
+#ifndef GETRANDOM_VAR__
+#define GETRANDOM_VAR__
+
+#include "lapi/syscalls.h"
+
+static inline int do_getrandom(void *buf, size_t buflen, unsigned int flags)
+{
+ switch (tst_variant) {
+ case 0:
+ return tst_syscall(__NR_getrandom, buf, buflen, flags);
+ case 1:
+ return getrandom(buf, buflen, flags);
+ }
+ return -1;
+}
+
+static void getrandom_info(void)
+{
+ switch (tst_variant) {
+ case 0:
+ tst_res(TINFO, "Testing SYS_getrandom syscall");
+ break;
+ case 1:
+ tst_res(TINFO, "Testing libc getrandom()");
+ break;
+ }
+}
+
+/* if we don't have libc getrandom() test only syscall version */
+#ifdef HAVE_SYS_RANDOM_H
+# define TEST_VARIANTS 2
+#else
+# define TEST_VARIANTS 1
+#endif
+
+#endif /* GETRANDOM_VAR__ */
--
2.43.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH v2] syscalls/getrandom05: add test variants
2024-12-06 13:36 ` [LTP] [PATCH v2] syscalls/getrandom05: add test variants Jan Stancek
@ 2024-12-06 14:34 ` Cyril Hrubis
2024-12-09 7:09 ` Li Wang
1 sibling, 0 replies; 8+ messages in thread
From: Cyril Hrubis @ 2024-12-06 14:34 UTC (permalink / raw)
To: Jan Stancek; +Cc: liwan, ltp
Hi!
Thanks for doing this:
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH v2] syscalls/getrandom05: add test variants
2024-12-06 13:36 ` [LTP] [PATCH v2] syscalls/getrandom05: add test variants Jan Stancek
2024-12-06 14:34 ` Cyril Hrubis
@ 2024-12-09 7:09 ` Li Wang
2024-12-09 7:31 ` Jan Stancek
1 sibling, 1 reply; 8+ messages in thread
From: Li Wang @ 2024-12-09 7:09 UTC (permalink / raw)
To: Jan Stancek; +Cc: ltp
On Fri, Dec 6, 2024 at 9:36 PM Jan Stancek <jstancek@redhat.com> wrote:
> And skip EFAULT for glibc as it can segfault in VDSO:
> #0 __arch_chacha20_blocks_nostack () at
> arch/x86/entry/vdso/vgetrandom-chacha.S:146
> 146 movups state0,0x00(output)
>
> (gdb) bt
> #0 __arch_chacha20_blocks_nostack () at
> arch/x86/entry/vdso/vgetrandom-chacha.S:146
> #1 0x00007fcd3ce6417a in __cvdso_getrandom_data
> (rng_info=0x7fcd3ce5f280, buffer=0xffffffffffffffff, len=64, flags=1,
> opaque_state=0x7fcd3ce5df00,
> opaque_len=<optimized out>) at
> arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:237
> #2 __cvdso_getrandom (buffer=<optimized out>, len=64, flags=1,
> opaque_state=0x7fcd3ce5df00, opaque_len=<optimized out>)
> at arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:259
> #3 __vdso_getrandom (buffer=0xffffffffffffffff, len=64, flags=1,
> opaque_state=0x7fcd3ce5df00, opaque_len=<optimized out>)
> at arch/x86/entry/vdso/vgetrandom.c:11
> #4 0x00007fcd3cc7faf3 in getrandom_vdso (buffer=0xffffffffffffffff,
> length=64, flags=0, cancel=<optimized out>)
> at ../sysdeps/unix/sysv/linux/getrandom.c:204
> #5 0x0000000000401ff7 in verify_getrandom (i=0) at getrandom05.c:40
>
> Signed-off-by: Jan Stancek <jstancek@redhat.com>
>
This one looks better.
Reviewed-by: Li Wang <liwang@redhat.com>
Li Wang
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH v2] syscalls/getrandom05: add test variants
2024-12-09 7:09 ` Li Wang
@ 2024-12-09 7:31 ` Jan Stancek
0 siblings, 0 replies; 8+ messages in thread
From: Jan Stancek @ 2024-12-09 7:31 UTC (permalink / raw)
To: Li Wang; +Cc: ltp
On Mon, Dec 9, 2024 at 8:10 AM Li Wang <liwan@redhat.com> wrote:
>
>
>
> On Fri, Dec 6, 2024 at 9:36 PM Jan Stancek <jstancek@redhat.com> wrote:
>>
>> And skip EFAULT for glibc as it can segfault in VDSO:
>> #0 __arch_chacha20_blocks_nostack () at arch/x86/entry/vdso/vgetrandom-chacha.S:146
>> 146 movups state0,0x00(output)
>>
>> (gdb) bt
>> #0 __arch_chacha20_blocks_nostack () at arch/x86/entry/vdso/vgetrandom-chacha.S:146
>> #1 0x00007fcd3ce6417a in __cvdso_getrandom_data (rng_info=0x7fcd3ce5f280, buffer=0xffffffffffffffff, len=64, flags=1, opaque_state=0x7fcd3ce5df00,
>> opaque_len=<optimized out>) at arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:237
>> #2 __cvdso_getrandom (buffer=<optimized out>, len=64, flags=1, opaque_state=0x7fcd3ce5df00, opaque_len=<optimized out>)
>> at arch/x86/entry/vdso/../../../../lib/vdso/getrandom.c:259
>> #3 __vdso_getrandom (buffer=0xffffffffffffffff, len=64, flags=1, opaque_state=0x7fcd3ce5df00, opaque_len=<optimized out>)
>> at arch/x86/entry/vdso/vgetrandom.c:11
>> #4 0x00007fcd3cc7faf3 in getrandom_vdso (buffer=0xffffffffffffffff, length=64, flags=0, cancel=<optimized out>)
>> at ../sysdeps/unix/sysv/linux/getrandom.c:204
>> #5 0x0000000000401ff7 in verify_getrandom (i=0) at getrandom05.c:40
>>
>> Signed-off-by: Jan Stancek <jstancek@redhat.com>
>
>
> This one looks better.
>
> Reviewed-by: Li Wang <liwang@redhat.com>
Pushed.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-12-09 7:31 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-04 14:18 [LTP] [PATCH] syscalls/getrandom05: use tst_syscall Jan Stancek
2024-12-05 1:48 ` Li Wang
2024-12-06 10:36 ` Cyril Hrubis
2024-12-06 10:55 ` Jan Stancek
2024-12-06 13:36 ` [LTP] [PATCH v2] syscalls/getrandom05: add test variants Jan Stancek
2024-12-06 14:34 ` Cyril Hrubis
2024-12-09 7:09 ` Li Wang
2024-12-09 7:31 ` Jan Stancek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox