All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bpf: fix return in bpf_skb_adjust_net
@ 2017-07-13  6:27 Kefeng Wang
  2017-07-13  9:20 ` Daniel Borkmann
  2017-07-13 16:19 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Kefeng Wang @ 2017-07-13  6:27 UTC (permalink / raw)
  To: Alexei Starovoitov, David S. Miller
  Cc: Daniel Borkmann, linux-kernel, netdev, Kefeng Wang

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>
---
 net/core/filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/filter.c b/net/core/filter.c
index c7f7370..f44fc22 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,
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] bpf: fix return in bpf_skb_adjust_net
  2017-07-13  6:27 [PATCH] bpf: fix return in bpf_skb_adjust_net Kefeng Wang
@ 2017-07-13  9:20 ` Daniel Borkmann
  2017-07-13 16:19 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2017-07-13  9:20 UTC (permalink / raw)
  To: Kefeng Wang, Alexei Starovoitov, David S. Miller; +Cc: linux-kernel, netdev

On 07/13/2017 08:27 AM, Kefeng Wang wrote:
> 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>

Sigh, yep of course. Thanks!

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] bpf: fix return in bpf_skb_adjust_net
  2017-07-13  6:27 [PATCH] bpf: fix return in bpf_skb_adjust_net Kefeng Wang
  2017-07-13  9:20 ` Daniel Borkmann
@ 2017-07-13 16:19 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-07-13 16:19 UTC (permalink / raw)
  To: wangkefeng.wang; +Cc: ast, daniel, linux-kernel, netdev

From: Kefeng Wang <wangkefeng.wang@huawei.com>
Date: Thu, 13 Jul 2017 14:27:58 +0800

> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-13 16:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-13  6:27 [PATCH] bpf: fix return in bpf_skb_adjust_net Kefeng Wang
2017-07-13  9:20 ` Daniel Borkmann
2017-07-13 16:19 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.