summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTushar Dave <tushar.n.dave@oracle.com>2018-09-12 22:15:29 +0200
committerDaniel Borkmann <daniel@iogearbox.net>2018-09-12 23:47:28 +0200
commit4c3d795cb012a378855543a775408fba1ccff6f2 (patch)
tree05b7ab8eac84d394f4c9688a7e2ced12af525b25 /net
parentdd066823db2ac4e22f721ec85190817b58059a54 (diff)
downloadlinux-4c3d795cb012a378855543a775408fba1ccff6f2.tar.bz2
bpf: use __GFP_COMP while allocating page
Helper bpg_msg_pull_data() can allocate multiple pages while linearizing multiple scatterlist elements into one shared page. However, if the shared page has size > PAGE_SIZE, using copy_page_to_iter() causes below warning. e.g. [ 6367.019832] WARNING: CPU: 2 PID: 7410 at lib/iov_iter.c:825 page_copy_sane.part.8+0x0/0x8 To avoid above warning, use __GFP_COMP while allocating multiple contiguous pages. Fixes: 015632bb30da ("bpf: sk_msg program helper bpf_sk_msg_pull_data") Signed-off-by: Tushar Dave <tushar.n.dave@oracle.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/filter.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index aecdeba052d3..5e00f2b85a56 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -2344,7 +2344,8 @@ BPF_CALL_4(bpf_msg_pull_data,
if (unlikely(bytes_sg_total > copy))
return -EINVAL;
- page = alloc_pages(__GFP_NOWARN | GFP_ATOMIC, get_order(copy));
+ page = alloc_pages(__GFP_NOWARN | GFP_ATOMIC | __GFP_COMP,
+ get_order(copy));
if (unlikely(!page))
return -ENOMEM;
p = page_address(page);