linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/seccomp: use 90s as timeout
@ 2020-06-01 12:32 Thadeu Lima de Souza Cascardo
  2020-06-01 19:49 ` Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2020-06-01 12:32 UTC (permalink / raw)
  To: linux-kselftest
  Cc: Thadeu Lima de Souza Cascardo, Kees Cook, Shuah Khan,
	linux-kernel, Andy Lutomirski, Will Drewry

As seccomp_benchmark tries to calibrate how many samples will take more
than 5 seconds to execute, it may end up picking up a number of samples
that take 10 (but up to 12) seconds. As the calibration will take double
that time, it takes around 20 seconds. Then, it executes the whole thing
again, and then once more, with some added overhead. So, the thing might
take more than 40 seconds, which is too close to the 45s timeout.

That is very dependent on the system where it's executed, so may not be
observed always, but it has been observed on x86 VMs. Using a 90s timeout
seems safe enough.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
---
 tools/testing/selftests/seccomp/settings | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/seccomp/settings b/tools/testing/selftests/seccomp/settings
index d61f00d8cad3..ba4d85f74cd6 100644
--- a/tools/testing/selftests/seccomp/settings
+++ b/tools/testing/selftests/seccomp/settings
@@ -1 +1 @@
-90
+timeout=90
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests/seccomp: use 90s as timeout
  2020-06-01 12:32 [PATCH] selftests/seccomp: use 90s as timeout Thadeu Lima de Souza Cascardo
@ 2020-06-01 19:49 ` Kees Cook
  0 siblings, 0 replies; 2+ messages in thread
From: Kees Cook @ 2020-06-01 19:49 UTC (permalink / raw)
  To: Thadeu Lima de Souza Cascardo
  Cc: linux-kselftest, Shuah Khan, linux-kernel, Andy Lutomirski, Will Drewry

On Mon, Jun 01, 2020 at 09:32:02AM -0300, Thadeu Lima de Souza Cascardo wrote:
> As seccomp_benchmark tries to calibrate how many samples will take more
> than 5 seconds to execute, it may end up picking up a number of samples
> that take 10 (but up to 12) seconds. As the calibration will take double
> that time, it takes around 20 seconds. Then, it executes the whole thing
> again, and then once more, with some added overhead. So, the thing might
> take more than 40 seconds, which is too close to the 45s timeout.
> 
> That is very dependent on the system where it's executed, so may not be
> observed always, but it has been observed on x86 VMs. Using a 90s timeout
> seems safe enough.
> 
> Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>

Excellent point! Thanks, I've applied this (well, actually, your v2)
to for-next/seccomp.

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-01 19:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-01 12:32 [PATCH] selftests/seccomp: use 90s as timeout Thadeu Lima de Souza Cascardo
2020-06-01 19:49 ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).