* [Virtio-fs] [PATCH] virtiofsd: Add clock_gettime() to seccomp white list
@ 2019-10-18 19:08 Masayoshi Mizuma
2019-10-18 19:17 ` Dr. David Alan Gilbert
0 siblings, 1 reply; 2+ messages in thread
From: Masayoshi Mizuma @ 2019-10-18 19:08 UTC (permalink / raw)
To: virtio-fs; +Cc: Masayoshi Mizuma
From: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
virtiofsd receives SIGSYS signal while qemu is shutting down.
]# ./virtiofsd -d -o vhost_user_socket=/tmp/vhostqemu0 \
-o source=/tmp/share0 -o cache=auto
...
virtio_send_msg: elem 0: with 1 in desc of length 16
virtio_loop: Got VU event
fv_queue_set_started: qidx=0 started=0
fv_queue_thread: kill event on queue 0 - quitting
fv_remove_watch: TODO! fd=9
virtio_loop: Waiting for VU event
Bad system call (core dumped)
]#
That is because virtiofsd calls clock_gettime() via glib
function and clock_gettime() isn't in seccomp white list,
so virtiofsd receives SIGSYS.
The glib function is called to manage the pool thread.
The calltrace is like as:
#0 clock_gettime ()
#1 g_get_monotonic_time ()
#2 g_async_queue_timeout_pop ()
#3 g_thread_pool_wait_for_new_pool ()
#4 g_thread_pool_thread_proxy ()
#5 g_thread_proxy ()
#6 start_thread ()
#7 clone ()
Add clock_gettime() to seccomp white list.
Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
---
contrib/virtiofsd/seccomp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/contrib/virtiofsd/seccomp.c b/contrib/virtiofsd/seccomp.c
index f815ea5bf9..b78056b13f 100644
--- a/contrib/virtiofsd/seccomp.c
+++ b/contrib/virtiofsd/seccomp.c
@@ -19,6 +19,7 @@ static const int syscall_whitelist[] = {
SCMP_SYS(brk),
SCMP_SYS(capget), /* For CAP_FSETID */
SCMP_SYS(capset),
+ SCMP_SYS(clock_gettime),
SCMP_SYS(clone),
SCMP_SYS(close),
SCMP_SYS(copy_file_range),
--
2.18.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Virtio-fs] [PATCH] virtiofsd: Add clock_gettime() to seccomp white list
2019-10-18 19:08 [Virtio-fs] [PATCH] virtiofsd: Add clock_gettime() to seccomp white list Masayoshi Mizuma
@ 2019-10-18 19:17 ` Dr. David Alan Gilbert
0 siblings, 0 replies; 2+ messages in thread
From: Dr. David Alan Gilbert @ 2019-10-18 19:17 UTC (permalink / raw)
To: Masayoshi Mizuma; +Cc: virtio-fs, Masayoshi Mizuma
* Masayoshi Mizuma (msys.mizuma@gmail.com) wrote:
> From: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
>
> virtiofsd receives SIGSYS signal while qemu is shutting down.
>
> ]# ./virtiofsd -d -o vhost_user_socket=/tmp/vhostqemu0 \
> -o source=/tmp/share0 -o cache=auto
> ...
> virtio_send_msg: elem 0: with 1 in desc of length 16
> virtio_loop: Got VU event
> fv_queue_set_started: qidx=0 started=0
> fv_queue_thread: kill event on queue 0 - quitting
> fv_remove_watch: TODO! fd=9
> virtio_loop: Waiting for VU event
> Bad system call (core dumped)
> ]#
>
> That is because virtiofsd calls clock_gettime() via glib
> function and clock_gettime() isn't in seccomp white list,
> so virtiofsd receives SIGSYS.
> The glib function is called to manage the pool thread.
> The calltrace is like as:
>
> #0 clock_gettime ()
> #1 g_get_monotonic_time ()
> #2 g_async_queue_timeout_pop ()
> #3 g_thread_pool_wait_for_new_pool ()
> #4 g_thread_pool_thread_proxy ()
> #5 g_thread_proxy ()
> #6 start_thread ()
> #7 clone ()
>
> Add clock_gettime() to seccomp white list.
>
> Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
Thanks; merged into the existing whitelist.
(And pushed to -dev - although the -dev world; which is in the middle
of a tidyup)
Dave
> ---
> contrib/virtiofsd/seccomp.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/contrib/virtiofsd/seccomp.c b/contrib/virtiofsd/seccomp.c
> index f815ea5bf9..b78056b13f 100644
> --- a/contrib/virtiofsd/seccomp.c
> +++ b/contrib/virtiofsd/seccomp.c
> @@ -19,6 +19,7 @@ static const int syscall_whitelist[] = {
> SCMP_SYS(brk),
> SCMP_SYS(capget), /* For CAP_FSETID */
> SCMP_SYS(capset),
> + SCMP_SYS(clock_gettime),
> SCMP_SYS(clone),
> SCMP_SYS(close),
> SCMP_SYS(copy_file_range),
> --
> 2.18.1
>
> _______________________________________________
> Virtio-fs mailing list
> Virtio-fs@redhat.com
> https://www.redhat.com/mailman/listinfo/virtio-fs
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-18 19:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-18 19:08 [Virtio-fs] [PATCH] virtiofsd: Add clock_gettime() to seccomp white list Masayoshi Mizuma
2019-10-18 19:17 ` Dr. David Alan Gilbert
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.