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

Function set_binary_attr

CVE-2022-34918/exploit/exploit.c:446–452  ·  view source on GitHub ↗

set_binary_attr(): Prepare a byte array netlink attribute @buffer: Buffer with data to send @buffer_size: Size of the previous buffer

Source from the content-addressed store, hash-verified

444// @buffer: Buffer with data to send
445// @buffer_size: Size of the previous buffer
446struct nlattr *set_binary_attr(struct nlattr *attr, uint16_t type, uint8_t *buffer, uint64_t buffer_size) {
447 attr->nla_type = type;
448 attr->nla_len = NLA_BIN_SIZE(buffer_size);
449 memcpy(NLA_ATTR(attr), buffer, buffer_size);
450
451 return (void *)attr + NLA_ALIGN(NLA_BIN_SIZE(buffer_size));
452}
453
454// ---------------------------------- nf_tables --------------------------------------
455#define KMALLOC64_KEYLEN (64 - 8 - 12 - 16) // Max size - elemsize - sizeof(nft_set_ext)(align) - min datasize

Callers 1

add_elem_to_setFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected