summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKefeng Wang <wangkefeng.wang@huawei.com>2017-07-13 14:27:58 +0800
committerDavid S. Miller <davem@davemloft.net>2017-07-13 09:18:46 -0700
commite4a6a3424b75f23f6bb1cc479974fc305a4b9f78 (patch)
tree393fdc5c041871489e8d9259f16e6a75c0726409
parentedaf3825182958a1fd5e39708fcb6ea48eca2060 (diff)
downloadlinux-stable-e4a6a3424b75f23f6bb1cc479974fc305a4b9f78.tar.gz
linux-stable-e4a6a3424b75f23f6bb1cc479974fc305a4b9f78.tar.bz2
linux-stable-e4a6a3424b75f23f6bb1cc479974fc305a4b9f78.zip
bpf: fix return in bpf_skb_adjust_net
The bpf_skb_adjust_net() ignores the return value of bpf_skb_net_shrink/grow, and always return 0, fix it by return 'ret'. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/core/filter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index c7f737058d89..f44fc22fd45a 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -2248,7 +2248,7 @@ static int bpf_skb_adjust_net(struct sk_buff *skb, s32 len_diff)
bpf_skb_net_grow(skb, len_diff_abs);
bpf_compute_data_end(skb);
- return 0;
+ return ret;
}
BPF_CALL_4(bpf_skb_adjust_room, struct sk_buff *, skb, s32, len_diff,