mirror of
https://github.com/criyle/go-sandbox.git
synced 2025-11-04 14:49:53 +08:00
remove debug infomation
This commit is contained in:
parent
beab51c98c
commit
7cebfb4eb8
@ -297,6 +297,7 @@ func (r *Runner) Start() (int, error) {
|
|||||||
|
|
||||||
// if both seccomp and ptrace is defined, then seccomp filter should have
|
// if both seccomp and ptrace is defined, then seccomp filter should have
|
||||||
// traced execve, thus child need parent attached to it first
|
// traced execve, thus child need parent attached to it first
|
||||||
|
// actually, this is not effective if pid namespace is unshared
|
||||||
if r.StopBeforeSeccomp || (r.Seccomp != nil && r.Ptrace) {
|
if r.StopBeforeSeccomp || (r.Seccomp != nil && r.Ptrace) {
|
||||||
// Stop to wait for ptrace tracer
|
// Stop to wait for ptrace tracer
|
||||||
_, _, err1 = syscall.RawSyscall(syscall.SYS_KILL, pid, uintptr(syscall.SIGSTOP), 0)
|
_, _, err1 = syscall.RawSyscall(syscall.SYS_KILL, pid, uintptr(syscall.SIGSTOP), 0)
|
||||||
|
|||||||
@ -26,7 +26,6 @@ func (h *Handler) CheckRead(fn string) runprogram.TraceAction {
|
|||||||
|
|
||||||
// CheckWrite checks whether the file have write permission
|
// CheckWrite checks whether the file have write permission
|
||||||
func (h *Handler) CheckWrite(fn string) runprogram.TraceAction {
|
func (h *Handler) CheckWrite(fn string) runprogram.TraceAction {
|
||||||
fmt.Println("write: ", fn)
|
|
||||||
if !h.FileSet.IsWritableFile(fn) {
|
if !h.FileSet.IsWritableFile(fn) {
|
||||||
return h.onDgsFileDetect(fn)
|
return h.onDgsFileDetect(fn)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,7 +42,7 @@ func (r *RunUnshared) Start() (rt tracer.TraceResult, err error) {
|
|||||||
WorkDir: r.WorkDir,
|
WorkDir: r.WorkDir,
|
||||||
Seccomp: bpf,
|
Seccomp: bpf,
|
||||||
NoNewPrivs: true,
|
NoNewPrivs: true,
|
||||||
StopBeforeSeccomp: true,
|
StopBeforeSeccomp: false,
|
||||||
UnshareFlags: UnshareFlags,
|
UnshareFlags: UnshareFlags,
|
||||||
Mounts: r.Mounts,
|
Mounts: r.Mounts,
|
||||||
PivotRoot: r.Root,
|
PivotRoot: r.Root,
|
||||||
@ -87,11 +87,11 @@ func (r *RunUnshared) Trace(runner *forkexec.Runner) (result tracer.TraceResult,
|
|||||||
result.RunningTime = time.Now().UnixNano() - fTime
|
result.RunningTime = time.Now().UnixNano() - fTime
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
// currently, we do not have any way to track mount syscall time usage
|
||||||
|
fTime = time.Now().UnixNano()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
pid, err := unix.Wait4(pgid, &wstatus, unix.WALL, &rusage)
|
pid, err := unix.Wait4(pgid, &wstatus, unix.WALL, &rusage)
|
||||||
if fTime == 0 {
|
|
||||||
fTime = time.Now().UnixNano()
|
|
||||||
}
|
|
||||||
r.println("wait4: ", wstatus)
|
r.println("wait4: ", wstatus)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, tracer.TraceCodeFatal
|
return result, tracer.TraceCodeFatal
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user