MCPcopy Index your code
hub / github.com/subtrace/subtrace / init

Function init

cmd/run/engine/process/handle.go:580–662  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

578var Handlers [1024]func(*Process, *seccomp.Notif) error
579
580func init() {
581 Handlers[unix.SYS_EXIT] = func(p *Process, n *seccomp.Notif) error {
582 return p.handleExit(n, int(n.Args[0]))
583 }
584 Handlers[unix.SYS_EXIT_GROUP] = func(p *Process, n *seccomp.Notif) error {
585 return p.handleExitGroup(n, int(n.Args[0]))
586 }
587
588 Handlers[unix.SYS_EXECVE] = func(p *Process, n *seccomp.Notif) error {
589 return p.handleExecve(n, uintptr(n.Args[0]), uintptr(n.Args[1]), uintptr(n.Args[2]))
590 }
591 Handlers[unix.SYS_EXECVEAT] = func(p *Process, n *seccomp.Notif) error {
592 return p.handleExecveat(n, int(int32(n.Args[0])), uintptr(n.Args[1]), uintptr(n.Args[2]), uintptr(n.Args[3]), int(n.Args[4]))
593 }
594
595 Handlers[unix.SYS_OPENAT] = func(p *Process, n *seccomp.Notif) error {
596 return p.handleOpen(n, int(int32(n.Args[0])), uintptr(n.Args[1]), int(n.Args[2]), int(n.Args[3]))
597 }
598
599 switch runtime.GOARCH {
600 case "amd64":
601 Handlers[syscalls.GetNumber("SYS_NEWFSTATAT")] = func(p *Process, n *seccomp.Notif) error {
602 return p.handleFstatat(n, int(int32(n.Args[0])), uintptr(n.Args[1]), uintptr(n.Args[2]), int(n.Args[3]))
603 }
604 case "arm64":
605 Handlers[syscalls.GetNumber("SYS_FSTATAT")] = func(p *Process, n *seccomp.Notif) error {
606 return p.handleFstatat(n, int(int32(n.Args[0])), uintptr(n.Args[1]), uintptr(n.Args[2]), int(n.Args[3]))
607 }
608 default:
609 panic(fmt.Sprintf("GOARCH=%s: unsupported", runtime.GOARCH))
610 }
611
612 Handlers[unix.SYS_STATX] = func(p *Process, n *seccomp.Notif) error {
613 return p.handleStatx(n, int(int32(n.Args[0])), uintptr(n.Args[1]), int(n.Args[2]), int(n.Args[3]), uintptr(n.Args[4]))
614 }
615
616 Handlers[unix.SYS_CLOSE] = func(p *Process, n *seccomp.Notif) error {
617 return p.handleClose(n, int(int32(n.Args[0])))
618 }
619
620 Handlers[unix.SYS_FCNTL] = func(p *Process, n *seccomp.Notif) error {
621 return p.handleFcntl(n, int(int32(n.Args[0])), int(n.Args[1]), int(n.Args[2]))
622 }
623
624 Handlers[unix.SYS_SOCKET] = func(p *Process, n *seccomp.Notif) error {
625 return p.handleSocket(n, int(n.Args[0]), int(n.Args[1]), int(n.Args[2]))
626 }
627
628 Handlers[unix.SYS_BIND] = func(p *Process, n *seccomp.Notif) error {
629 return p.handleBind(n, int(int32(n.Args[0])), uintptr(n.Args[1]), int(n.Args[2]))
630 }
631
632 Handlers[unix.SYS_CONNECT] = func(p *Process, n *seccomp.Notif) error {
633 return p.handleConnect(n, int(int32(n.Args[0])), uintptr(n.Args[1]), int(n.Args[2]))
634 }
635
636 Handlers[unix.SYS_LISTEN] = func(p *Process, n *seccomp.Notif) error {
637 return p.handleListen(n, int(int32(n.Args[0])), int(n.Args[1]))

Callers

nothing calls this directly

Calls 15

GetNumberFunction · 0.92
handleExitMethod · 0.80
handleExitGroupMethod · 0.80
handleExecveMethod · 0.80
handleExecveatMethod · 0.80
handleOpenMethod · 0.80
handleFstatatMethod · 0.80
handleStatxMethod · 0.80
handleCloseMethod · 0.80
handleFcntlMethod · 0.80
handleSocketMethod · 0.80
handleBindMethod · 0.80

Tested by

no test coverage detected