Home | History | Annotate | Download | only in linux
      1 # Copyright 2018 syzkaller project authors. All rights reserved.
      2 # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
      3 
      4 include <uapi/linux/sched.h>
      5 
      6 resource fd_namespace[fd]
      7 
      8 unshare(flags flags[unshare_flags])
      9 setns(fd fd_namespace, type flags[ns_type])
     10 
     11 syz_open_procfs$namespace(pid pid, file ptr[in, string[procfs_namespace_file]]) fd_namespace
     12 
     13 procfs_namespace_file = "ns/cgroup", "ns/ipc", "ns/mnt", "ns/net", "ns/pid", "ns/user", "ns/uts", "ns/pid_for_children"
     14 
     15 unshare_flags = CLONE_FILES, CLONE_FS, CLONE_NEWCGROUP, CLONE_NEWIPC, CLONE_NEWNET, CLONE_NEWNS, CLONE_NEWPID, CLONE_NEWUSER, CLONE_NEWUTS, CLONE_SYSVSEM, CLONE_THREAD, CLONE_SIGHAND, CLONE_VM
     16 ns_type = 0, CLONE_NEWIPC, CLONE_NEWNET, CLONE_NEWUTS, CLONE_NEWCGROUP, CLONE_NEWNS, CLONE_NEWPID, CLONE_NEWUSER
     17