net: Do not allocate page fragments that are not skb aligned
authorAlexander Duyck <alexander.h.duyck@linux.intel.com>
Fri, 15 Feb 2019 22:44:18 +0000 (14:44 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Feb 2019 08:06:43 +0000 (09:06 +0100)
commit859838ff68a119a34a562b7a8384204c2c2782b2
treeb09af2762726f72e59bbfbfce8beaad45f1bff51
parent55103aa317afce598ee93ba3a3c5eb64ce4e6238
net: Do not allocate page fragments that are not skb aligned

[ Upstream commit 3bed3cc4156eedf652b4df72bdb35d4f1a2a739d ]

This patch addresses the fact that there are drivers, specifically tun,
that will call into the network page fragment allocators with buffer sizes
that are not cache aligned. Doing this could result in data alignment
and DMA performance issues as these fragment pools are also shared with the
skb allocator and any other devices that will use napi_alloc_frags or
netdev_alloc_frags.

Fixes: ffde7328a36d ("net: Split netdev_alloc_frag into __alloc_page_frag and add __napi_alloc_frag")
Reported-by: Jann Horn <jannh@google.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/skbuff.c