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:   Fri, 18 Jan 2019 11:50:17 +0800
From:   Jason Wang <jasowang@...hat.com>
To:     Toshiaki Makita <makita.toshiaki@....ntt.co.jp>,
        "David S. Miller" <davem@...emloft.net>,
        "Michael S. Tsirkin" <mst@...hat.com>
Cc:     netdev@...r.kernel.org, virtualization@...ts.linux-foundation.org,
        Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH net 2/7] virtio_net: Don't call free_old_xmit_skbs for
 xdp_frames


On 2019/1/18 上午9:44, Toshiaki Makita wrote:
> On 2019/01/17 21:39, Jason Wang wrote:
>> On 2019/1/17 下午7:20, Toshiaki Makita wrote:
>>> When napi_tx is enabled, virtnet_poll_cleantx() called
>>> free_old_xmit_skbs() even for xdp send queue.
>>> This is bogus since the queue has xdp_frames, not sk_buffs, thus mangled
>>> device tx bytes counters because skb->len is meaningless value, and even
>>> triggered oops due to general protection fault on freeing them.
>>>
>>> Since xdp send queues do not aquire locks, old xdp_frames should be
>>> freed only in virtnet_xdp_xmit(), so just skip free_old_xmit_skbs() for
>>> xdp send queues.
>>>
>>> Similarly virtnet_poll_tx() called free_old_xmit_skbs(). This NAPI
>>> handler is called even without calling start_xmit() because cb for tx is
>>> by default enabled. Once the handler is called, it enabled the cb again,
>>> and then the handler would be called again. We don't need this handler
>>> for XDP, so don't enable cb as well as not calling free_old_xmit_skbs().
>>>
>>> Also, we need to disable tx NAPI when disabling XDP, so
>>> virtnet_poll_tx() can safely access curr_queue_pairs and
>>> xdp_queue_pairs, which are not atomically updated while disabling XDP.
>>
>> I suggest to split this into another patch or squash this part to patch 1.
> This part is for invocation of is_xdp_raw_buffer_queue() from
> virtnet_poll_tx(), which is added in this patch, so I'm thinking it's
> more natural to keep this hunk in this patch.


I see.

Acked-by: Jason Wang <jasowang@...hat.com>

Thanks

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ