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]
Message-ID: <CALx6S36tzYiW1tWs1kuRcj9XcD5wgtzsVejsEHAERfKTQRZyeQ@mail.gmail.com>
Date:	Fri, 20 Nov 2015 15:20:33 -0800
From:	Tom Herbert <tom@...bertland.com>
To:	Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc:	"David S. Miller" <davem@...emloft.net>,
	Linux Kernel Network Developers <netdev@...r.kernel.org>,
	Kernel Team <kernel-team@...com>, davewatson@...com
Subject: Re: [PATCH net-next 4/6] kcm: Kernel Connection Multiplexor module

On Fri, Nov 20, 2015 at 3:10 PM, Alexei Starovoitov
<alexei.starovoitov@...il.com> wrote:
> On Fri, Nov 20, 2015 at 01:21:58PM -0800, Tom Herbert wrote:
>> +
>> +     while (eaten < orig_len) {
>> +             /* Always clone since we will consume something */
>> +             skb = skb_clone(orig_skb, GFP_ATOMIC);
>> +             if (!skb) {
>> +                     desc->error = -ENOMEM;
>> +                     break;
>> +             }
> ...
>> +             if (!pskb_pull(skb, offset + eaten)) {
>
> pskb_pull after clone == pskb_expand_head
> meaning that we'll be linearizing things all the time.
> can we try skb_share_check() first ?
> the packet shouldn't be shared at this point, so it might save a lot.
>
Yes it might. This pull does seem to be expensive.

>> +                     kfree_skb(skb);
>> +                     desc->error = -ENOMEM;
>> +                     break;
>> +             }
> ...
>> +             /* Need to trim, should be rare? */
>> +             err = pskb_trim(skb, orig_len - eaten);
> ...
>> +             if (!rxm->full_len) {
>> +                     ssize_t len;
>> +
>> +                     len = KCM_RUN_FILTER(psock->bpf_prog, head);
>
> bpf can read packet beyond linear header just fine.
> It's slower than reads from header, since extra calls invovled,
> but if that becomes a bottle neck we can optimize the way we do JIT there.
>
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ