diff mbox

[net] bpf: fix bpf_setsockopts return value

Message ID 20170824224821.31672-1-ycheng@google.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Yuchung Cheng Aug. 24, 2017, 10:48 p.m. UTC
This patch fixes a bug causing any sock operations to always return EINVAL.

Fixes: a5192c52377e ("bpf: fix to bpf_setsockops").
Reported-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Craig Gallek <kraig@google.com>
---
 net/core/filter.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Daniel Borkmann Aug. 24, 2017, 11:37 p.m. UTC | #1
On 08/25/2017 12:48 AM, Yuchung Cheng wrote:
> This patch fixes a bug causing any sock operations to always return EINVAL.
>
> Fixes: a5192c52377e ("bpf: fix to bpf_setsockops").
> Reported-by: Neal Cardwell <ncardwell@google.com>
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
> Acked-by: Neal Cardwell <ncardwell@google.com>
> Acked-by: Craig Gallek <kraig@google.com>

Ohh well, thanks for the fix!

Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Lawrence Brakmo Aug. 24, 2017, 11:45 p.m. UTC | #2
On 8/24/17, 4:37 PM, "Daniel Borkmann" <daniel@iogearbox.net> wrote:

    On 08/25/2017 12:48 AM, Yuchung Cheng wrote:
    > This patch fixes a bug causing any sock operations to always return EINVAL.

    >

    > Fixes: a5192c52377e ("bpf: fix to bpf_setsockops").

    > Reported-by: Neal Cardwell <ncardwell@google.com>

    > Signed-off-by: Yuchung Cheng <ycheng@google.com>

    > Acked-by: Neal Cardwell <ncardwell@google.com>

    > Acked-by: Craig Gallek <kraig@google.com>

    
    Ohh well, thanks for the fix!
    
    Acked-by: Daniel Borkmann <daniel@iogearbox.net>


Thanks! I never checked return values in by bpf test programs

Acked-by: Lawrence Brakmo <brakmo@fb.com>
David Miller Aug. 25, 2017, 1:24 a.m. UTC | #3
From: Yuchung Cheng <ycheng@google.com>
Date: Thu, 24 Aug 2017 15:48:21 -0700

> This patch fixes a bug causing any sock operations to always return EINVAL.
> 
> Fixes: a5192c52377e ("bpf: fix to bpf_setsockops").
> Reported-by: Neal Cardwell <ncardwell@google.com>
> Signed-off-by: Yuchung Cheng <ycheng@google.com>
> Acked-by: Neal Cardwell <ncardwell@google.com>
> Acked-by: Craig Gallek <kraig@google.com>

Applied.
diff mbox

Patch

diff --git a/net/core/filter.c b/net/core/filter.c
index 6280a602604c..8eb81e5fae08 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -2872,7 +2872,6 @@  BPF_CALL_5(bpf_setsockopt, struct bpf_sock_ops_kern *, bpf_sock,
 				ret = -EINVAL;
 			}
 		}
-		ret = -EINVAL;
 #endif
 	} else {
 		ret = -EINVAL;