From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Borkmann Subject: Re: [net-next PATCH] bpf/cpumap: make sure frame_size for build_skb is aligned if headroom isn't Date: Thu, 20 Dec 2018 23:25:46 +0100 Message-ID: <5cd8471e-527c-7273-b3a4-f6fe3fe238aa@iogearbox.net> References: <154523522306.21104.9074815363480240934.stgit@firesoul> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: Jesper Dangaard Brouer , netdev@vger.kernel.org Return-path: Received: from www62.your-server.de ([213.133.104.62]:52610 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390134AbeLTWZt (ORCPT ); Thu, 20 Dec 2018 17:25:49 -0500 In-Reply-To: <154523522306.21104.9074815363480240934.stgit@firesoul> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 12/19/2018 05:00 PM, Jesper Dangaard Brouer wrote: > The frame_size passed to build_skb must be aligned, else it is > possible that the embedded struct skb_shared_info gets unaligned. > > For correctness make sure that xdpf->headroom in included in the > alignment. No upstream drivers can hit this, as all XDP drivers provide > an aligned headroom. This was discovered when playing with implementing > XDP support for mvneta, which have a 2 bytes DSA header, and this > Marvell ARM64 platform didn't like doing atomic operations on an > unaligned skb_shinfo(skb)->dataref addresses. > > Fixes: 1c601d829ab0 ("bpf: cpumap xdp_buff to skb conversion and allocation") > Signed-off-by: Jesper Dangaard Brouer Applied to bpf-next, thanks!