All of lore.kernel.org
 help / color / mirror / Atom feed
* Invoking a system call from within the kernel
@ 2017-11-16  2:16 Demi Marie Obenour
  2017-11-16  9:54 ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Demi Marie Obenour @ 2017-11-16  2:16 UTC (permalink / raw)
  To: kernelnewbies

I am looking to write my first driver.  This driver will create a single
character device, which can be opened by any user.  The device will
support one ioctl:

        long ioctl_syscall(int fd, long syscall, long args[6]);

This is simply equivalent to:

        syscall(syscall, args[0], args[1], args[2], args[3], args[4],
                args[5], args[6]);

and indeed I want it to behave *identically* to that.  That means that
ptracers are notified about the syscall (and given the opportunity to
update its arguments), and that seccomp_bpf filters are applied.
Furthermore, it means that all arguments to the syscall need full
validation, as if they came from userspace (because they do).

Is there an in-kernel API that allows one to invoke an arbitrary syscall
with arguments AND proper ptrace/seccomp_bpf filtering?  If not, how
difficult would it be to create one?

Sincerely,

Demi Obenour

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

end of thread, other threads:[~2017-11-19  9:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-16  2:16 Invoking a system call from within the kernel Demi Marie Obenour
2017-11-16  9:54 ` Greg KH
2017-11-18 18:15   ` Demi Marie Obenour
2017-11-18 18:44     ` valdis.kletnieks at vt.edu
2017-11-18 19:09       ` Demi Marie Obenour
2017-11-19  0:49         ` valdis.kletnieks at vt.edu
2017-11-19  9:50         ` Greg KH

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.