lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 4 Jan 2016 11:22:24 -0500
From:	Craig Gallek <kraigatgoog@...il.com>
To:	Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc:	netdev@...r.kernel.org, David Miller <davem@...emloft.net>
Subject: Re: [PATCH v2 net-next 3/4] soreuseport: setsockopt SO_ATTACH_REUSEPORT_[CE]BPF

On Tue, Dec 29, 2015 at 6:50 PM, Alexei Starovoitov
<alexei.starovoitov@...il.com> wrote:
> On Tue, Dec 29, 2015 at 12:29:09PM -0500, Craig Gallek wrote:
>> From: Craig Gallek <kraig@...gle.com>
>> +static struct sock *run_bpf(struct sock_reuseport *reuse, u16 socks,
>> +                         struct bpf_prog *prog, struct sk_buff *skb,
>> +                         int hdr_len)
>> +{
>> +     struct sk_buff *nskb = NULL;
>> +     u32 index;
>> +
>> +     if (skb_shared(skb)) {
>> +             nskb = skb_clone(skb, GFP_ATOMIC);
>> +             if (!nskb)
>> +                     return NULL;
>> +             skb = nskb;
>> +     }
>> +
>> +     /* temporarily advance data past protocol header */
>> +     if (!pskb_may_pull(skb, hdr_len) || !skb_pull_inline(skb, hdr_len)) {
>
> pskb_pull() would be cleaner.
ACK -> v3

>> +             consume_skb(nskb);
>> +             return NULL;
>> +     }
>> +     index = bpf_prog_run_save_cb(prog, skb);
>> +     __skb_push(skb, hdr_len);
>
> This indeed matches what normal bpf filters see with udp sockets, so
> I guess that's fine.
> Acked-by: Alexei Starovoitov <ast@...nel.org>
Thanks for the review!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists