summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/bpf.h
diff options
context:
space:
mode:
authorAlexei Starovoitov2014-12-02 00:06:34 +0100
committerDavid S. Miller2014-12-06 06:47:32 +0100
commitddd872bc3098f9d9abe1680a6b2013e59e3337f7 (patch)
treebe98ca10e99f38fc5f84e94bacee95db64183b15 /include/uapi/linux/bpf.h
parenttun/macvtap: use consume_skb() instead of kfree_skb() when needed (diff)
downloadkernel-qcow2-linux-ddd872bc3098f9d9abe1680a6b2013e59e3337f7.tar.gz
kernel-qcow2-linux-ddd872bc3098f9d9abe1680a6b2013e59e3337f7.tar.xz
kernel-qcow2-linux-ddd872bc3098f9d9abe1680a6b2013e59e3337f7.zip
bpf: verifier: add checks for BPF_ABS | BPF_IND instructions
introduce program type BPF_PROG_TYPE_SOCKET_FILTER that is used for attaching programs to sockets where ctx == skb. add verifier checks for ABS/IND instructions which can only be seen in socket filters, therefore the check: if (env->prog->aux->prog_type != BPF_PROG_TYPE_SOCKET_FILTER) verbose("BPF_LD_ABS|IND instructions are only allowed in socket filters\n"); Signed-off-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/bpf.h')
-rw-r--r--include/uapi/linux/bpf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 4a3d0f84f178..45da7ec7d274 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -117,6 +117,7 @@ enum bpf_map_type {
enum bpf_prog_type {
BPF_PROG_TYPE_UNSPEC,
+ BPF_PROG_TYPE_SOCKET_FILTER,
};
/* flags for BPF_MAP_UPDATE_ELEM command */