[Virtio-fs] [PATCH] virtiofsd: Add gettimeofday to the seccomp whitelist
Dr. David Alan Gilbert
dgilbert at redhat.com
Wed Jul 31 16:29:41 UTC 2019
* Stefan Hajnoczi (stefanha at redhat.com) wrote:
> On Tue, Jul 30, 2019 at 05:50:00PM -0400, Masayoshi Mizuma wrote:
> > From: Masayoshi Mizuma <m.mizuma at jp.fujitsu.com>
> >
> > When I run fsstress on the virtio filesystem, virtiofsd sometimes
> > exits abnormally because it receives SIGSYS.
> >
> > >From strace:
> > 195852 15:07:47.799331 read(8, "\1\0\0\0\0\0\0\0", 8) = 8 <0.000011>
> > 195852 15:07:47.799379 gettimeofday( <unfinished ...>
> > 195852 15:07:53.354340 <... gettimeofday resumed> <unfinished ...>) = ?
> > 195852 15:07:53.400243 +++ killed by SIGSYS (core dumped) +++
> >
> > That is because virtiofsd calls gettimeofday() system call but
> > the system call isn't in the seccomp whitelist.
> >
> > virtiofsd doesn't call gettimeofday() directly. glib library
> > function may call g_get_current_time() and g_get_current_time()
> > calls the system call.
> >
> > Add gettimeofday() to the seccomp whitelist.
> >
> > Signed-off-by: Masayoshi Mizuma <m.mizuma at jp.fujitsu.com>
> > ---
> > contrib/virtiofsd/seccomp.c | 1 +
> > 1 file changed, 1 insertion(+)
>
> Have you checked that your guest is using the vdso gettimeofday()
> implementation? gettimeofday() is implemented in userspace without a
> syscall using vdso to improve performance. If your guest isn't using it
> then performance will be worse. (There is a fallback code path in the
> vdso that invokes the syscall but I'm not sure it is taken in normal
> cases.)
>
> The patch is fine though:
>
> Reviewed-by: Stefan Hajnoczi <stefanha at redhat.com>
Thanks,
Applied.
> _______________________________________________
> Virtio-fs mailing list
> Virtio-fs at redhat.com
> https://www.redhat.com/mailman/listinfo/virtio-fs
--
Dr. David Alan Gilbert / dgilbert at redhat.com / Manchester, UK
More information about the Virtio-fs
mailing list