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  linux-hardening  linux-cve-announce  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:   Thu, 20 Apr 2017 02:01:49 +0200
From:   Daniel Borkmann <daniel@...earbox.net>
To:     Johannes Berg <johannes@...solutions.net>,
        Alexei Starovoitov <ast@...nel.org>
CC:     netdev <netdev@...r.kernel.org>
Subject: Re: __sk_buff.data_end

On 04/20/2017 12:20 AM, Johannes Berg wrote:
> On Wed, 2017-04-19 at 23:31 +0200, Johannes Berg wrote:
>> Hi Alexei, Daniel,
>>
>> I'm looking at adding the __wifi_sk_buff I talked about, and I notice
>> that it uses CB space to store data_end. Unfortunately, in a lot of
>> cases, we don't have any CB space to spare in wifi.
>
> I guess I can work around this, would this seem reasonable?
>
>   struct bpf_skb_data_end {
>          struct qdisc_skb_cb qdisc_cb;
> -       void *data_end;
> +       /*
> +        * The alignment here is for mac80211, since that doesn't use
> +        * a pointer but a u64 value and needs to save/restore that
> +        * across running its BPF programs.
> +        */
> +       void *data_end __aligned(sizeof(u64));
>   };

Yeah, should work as well for the 32 bit archs, on 64 bit we
have this effectively already:

struct bpf_skb_data_end {
         struct qdisc_skb_cb        qdisc_cb;             /*     0    28 */

         /* XXX 4 bytes hole, try to pack */

         void *                     data_end;             /*    32     8 */

         /* size: 40, cachelines: 1, members: 2 */
         /* sum members: 36, holes: 1, sum holes: 4 */
         /* last cacheline: 40 bytes */
};

Can you elaborate on why this works for mac80211? It uses cb
only up to that point from where you invoke the prog?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ