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

Function netdevsim_add

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

Source from the content-addressed store, hash-verified

658#define DEV_MAC 0x00aaaaaaaaaa
659
660static void netdevsim_add(unsigned int addr, unsigned int port_count)
661{
662 char buf[16];
663 sprintf(buf, "%u %u", addr, port_count);
664 if (write_file("/sys/bus/netdevsim/new_device", buf)) {
665 snprintf(buf, sizeof(buf), "netdevsim%d", addr);
666 initialize_devlink_ports("netdevsim", buf, "netdevsim");
667 }
668}
669
670#define WG_GENL_NAME "wireguard"
671enum wg_cmd {

Callers 1

initialize_netdevicesFunction · 0.85

Calls 2

initialize_devlink_portsFunction · 0.85
write_fileFunction · 0.70

Tested by

no test coverage detected