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: <fb5ab568-9bc8-3145-a8db-3e975ccdf846@gmail.com>
Date:   Tue, 31 Mar 2020 14:45:26 +0900
From:   Toshiaki Makita <toshiaki.makita1@...il.com>
To:     maowenan <maowenan@...wei.com>,
        Jesper Dangaard Brouer <jbrouer@...hat.com>
Cc:     davem@...emloft.net, ast@...nel.org, daniel@...earbox.net,
        kuba@...nel.org, hawk@...nel.org, john.fastabend@...il.com,
        kafai@...com, songliubraving@...com, yhs@...com, andriin@...com,
        jwi@...ux.ibm.com, jianglidong3@...com, edumazet@...gle.com,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        bpf@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH net] veth: xdp: use head instead of hard_start

On 2020/03/31 12:56, maowenan wrote:
> On 2020/3/31 7:35, Toshiaki Makita wrote:
>> Hi Mao & Jesper
>> (Resending with plain text...)
>>
>> On 2020/03/30 20:34, Jesper Dangaard Brouer wrote:
>>> On Mon, 30 Mar 2020 18:26:31 +0800
>>> Mao Wenan <maowenan@...wei.com> wrote:
>>>
>>>> xdp.data_hard_start is mapped to the first
>>>> address of xdp_frame, but the pointer hard_start
>>>> is the offset(sizeof(struct xdp_frame)) of xdp_frame,
>>>> it should use head instead of hard_start to
>>>> set xdp.data_hard_start. Otherwise, if BPF program
>>>> calls helper_function such as bpf_xdp_adjust_head, it
>>>> will be confused for xdp_frame_end.
>>>
>>> I have noticed this[1] and have a patch in my current patchset for
>>> fixing this.  IMHO is is not so important fix right now, as the effect
>>> is that you currently only lose 32 bytes of headroom.
>>>
> I consider that it is needed because bpf_xdp_adjust_head() just a common helper function,
> veth as one driver application should keep the same as 32 bytes of headroom as other driver.
> And convert_to_xdp_frame set() also store info in top of packet, and set:
> 	xdp_frame = xdp->data_hard_start;
> 
>>> [1] https://lore.kernel.org/netdev/158446621887.702578.17234304084556809684.stgit@firesoul/
>>
>> You are right, the subtraction is not necessary here.
> I guess you mean that previous subtraction is not necessary ? this line : void *head = hard_start - sizeof(struct xdp_frame); ?

No I just mean subtraction of headroom is not necessary, and I noticed this 
description was confusing. Sorry about that.
You can use "head" for data_hard_start.

Toshiaki Makita

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ