Skip to content

Invalid Argument - clone(flags=CLONE_NEWNS|CLONE_NEWCGROUP|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWUSER|CLONE_NEWPID) failed #232

@ndeloney0

Description

@ndeloney0

Hi,

I am trying to run nsjail with a very simple python script and am getting the following:

Mode: STANDALONE_ONCE\n[I][2024-06-16T03:25:03+0000] 
Jail parameters: hostname:'python', chroot:'', process:'python3', bind:[::]:0, max_conns:0, max_conns_per_ip:0, time_limit:900, personality:0, daemonize:false, clone_newnet:false, clone_newuser:true, clone_newns:true, clone_newpid:true, clone_newipc:true, clone_newuts:true, clone_newcgroup:true, clone_newtime:false, keep_caps:false, disable_no_new_privs:false, max_cpus:0\n[I][2024-06-16T03:25:03+0000]
Mount: '/' flags:MS_RDONLY type:'tmpfs' options:'' dir:true\n[I][2024-06-16T03:25:03+0000] 
Mount: '/' -> '/' flags:MS_RDONLY|MS_BIND|MS_REC|MS_PRIVATE type:'' options:'' dir:true\n[I][2024-06-16T03:25:03+0000] 
Mount: '/app' -> '/app' flags:MS_BIND|MS_REC|MS_PRIVATE type:'' options:'' dir:true\n[I][2024-06-16T03:25:03+0000] Mount: '/tmp' -> '/tmp' flags:MS_BIND|MS_REC|MS_PRIVATE type:'' options:'' dir:true\n[I][2024-06-16T03:25:03+0000] Uid map: inside_uid:0 outside_uid:0 count:1 newuidmap:false\n[W][2024-06-16T03:25:03+0000][6] 
logParams():313 Process will be UID/EUID=0 in the global user namespace, and will have user root-level access to files\n[I][2024-06-16T03:25:03+0000] 
Gid map: inside_gid:0 outside_gid:0 count:1 newgidmap:false\n[W][2024-06-16T03:25:03+0000][6] 
logParams():323 Process will be GID/EGID=0 in the global user namespace, and will have group root-level access to files\n[W][2024-06-16T03:25:03+0000][6] 

The last lines seem to be the error:

runChild():491 clone(flags=CLONE_NEWNS|CLONE_NEWCGROUP|CLONE_NEWUTS|CLONE_NEWIPC|CLONE_NEWUSER|CLONE_NEWPID) failed: Invalid argument\n[E][2024-06-16T03:25:03+0000][6] 
standaloneMode():275 Couldn't launch the child process\n"}

I have seen similar issues such as #111 and have tried adding this --disable_clone_newcgroup flag, but it doesn't seem to help. Any advice on how I can proceed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions