Bug 240874 - Linuxolator: unimplemented linux syscalls: memfd_create, inotify_init{,1}
Summary: Linuxolator: unimplemented linux syscalls: memfd_create, inotify_init{,1}
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-emulation (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-27 15:01 UTC by Bjoern A. Zeeb
Modified: 2020-06-29 03:09 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bjoern A. Zeeb freebsd_committer 2019-09-27 15:01:31 UTC
Hi,

is anyone working on implementing the following linux syscalls?

memfd_create()
inotify_init()
inotify_init1()

There's Linux binary-only software which seems to require it.
Comment 1 Kyle Evans freebsd_committer 2019-09-28 00:08:29 UTC
(In reply to Bjoern A. Zeeb from comment #0)

Heh, we just implemented memfd_create in terms of shm_open2. I'll take a look at implementing the Linux syscall version- it should be fairly simple now that we implement everything it needs.
Comment 2 commit-hook freebsd_committer 2020-06-29 03:09:55 UTC
A commit references this bug:

Author: kevans
Date: Mon Jun 29 03:09:16 UTC 2020
New revision: 362769
URL: https://svnweb.freebsd.org/changeset/base/362769

Log:
  linuxolator: implement memfd_create syscall

  This effectively mirrors our libc implementation, but with minor fudging --
  name needs to be copied in from userspace, so we just copy it straight into
  stack-allocated memfd_name into the correct position rather than allocating
  memory that needs to be cleaned up.

  The sealing-related fcntl(2) commands, F_GET_SEALS and F_ADD_SEALS, have
  also been implemented now that we support them.

  Note that this implementation is still not quite at feature parity w.r.t.
  the actual Linux version; some caveats, from my foggy memory:

  - Need to implement SHM_GROW_ON_WRITE, default for memfd (in progress)
  - LTP wants the memfd name exposed to fdescfs
  - Linux allows open() of an fdescfs fd with O_TRUNC to truncate after dup.
    (?)

  Interested parties can install and run LTP from ports (devel/linux-ltp) to
  confirm any fixes.

  PR:		240874
  Reviewed by:	kib, trasz
  Differential Revision:	https://reviews.freebsd.org/D21845

Changes:
  head/sys/amd64/linux/linux_dummy.c
  head/sys/amd64/linux32/linux32_dummy.c
  head/sys/arm64/linux/linux_dummy.c
  head/sys/compat/linux/linux.c
  head/sys/compat/linux/linux.h
  head/sys/compat/linux/linux_file.c
  head/sys/compat/linux/linux_file.h
  head/sys/i386/linux/linux_dummy.c