Files
kernel_arpi/include/linux
Alexei Starovoitov 9bac3d6d54 bpf: allow extended BPF programs access skb fields
introduce user accessible mirror of in-kernel 'struct sk_buff':
struct __sk_buff {
    __u32 len;
    __u32 pkt_type;
    __u32 mark;
    __u32 queue_mapping;
};

bpf programs can do:

int bpf_prog(struct __sk_buff *skb)
{
    __u32 var = skb->pkt_type;

which will be compiled to bpf assembler as:

dst_reg = *(u32 *)(src_reg + 4) // 4 == offsetof(struct __sk_buff, pkt_type)

bpf verifier will check validity of access and will convert it to:

dst_reg = *(u8 *)(src_reg + offsetof(struct sk_buff, __pkt_type_offset))
dst_reg &= 7

since skb->pkt_type is a bitfield.

Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-15 22:02:28 -04:00
..
2015-02-19 13:31:40 +03:00
2015-01-29 10:49:28 +02:00
2015-02-18 07:28:37 -08:00
2015-02-02 14:23:42 -08:00
2014-12-18 19:08:10 -08:00
2015-02-12 18:54:15 -08:00
2014-12-19 22:55:06 +01:00
2015-01-21 19:21:30 +01:00
2015-03-02 16:43:41 -05:00
2014-12-31 13:06:50 -05:00
2015-01-25 23:17:28 -05:00
2015-01-27 11:09:13 +01:00
2015-02-20 15:24:04 -05:00
2015-01-15 10:34:54 +01:00
2015-01-15 10:34:54 +01:00
2015-02-13 21:21:36 -08:00
2015-02-17 14:34:51 -08:00
2014-12-18 09:39:51 +01:00
2015-01-04 23:11:43 -05:00
2015-02-11 17:06:02 -08:00
2015-03-12 14:39:40 -04:00
2015-03-11 17:56:28 -04:00
2015-01-25 23:17:28 -05:00
2015-02-17 14:34:52 -08:00
2015-01-06 11:01:13 -08:00
2015-02-16 17:56:03 -08:00
2015-03-02 00:19:30 -05:00
2015-02-13 21:21:41 -08:00
2015-01-22 15:10:56 +01:00
2015-03-11 21:55:28 -04:00
2015-03-04 00:26:06 -05:00
2015-01-03 14:32:57 -05:00
2015-02-13 21:21:35 -08:00
2015-02-28 15:10:39 -05:00