summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/verifier_mtu.c
blob: 70c7600a26a0a3399169f910e107af0f2290f99c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// SPDX-License-Identifier: GPL-2.0

#include "vmlinux.h"
#include <bpf/bpf_helpers.h>
#include "bpf_misc.h"

SEC("tc/ingress")
__description("uninit/mtu: write rejected")
__failure __msg("invalid indirect read from stack")
int tc_uninit_mtu(struct __sk_buff *ctx)
{
	__u32 mtu;

	bpf_check_mtu(ctx, 0, &mtu, 0, 0);
	return TCX_PASS;
}

char LICENSE[] SEC("license") = "GPL";