[PATCH net-next] bpf: Collapse offset checks in sock_filter_is_valid_access

Subsystems: bpf [general] (safe dynamic programs and tools), bpf [networking] (tcx & tc bpf, sock_addr), networking [general], the rest

STALE3291d

4 messages, 4 authors, 2017-09-01 · open the first message on its own page

[PATCH net-next] bpf: Collapse offset checks in sock_filter_is_valid_access

From: David Ahern <hidden>
Date: 2017-09-01 15:18:19

Make sock_filter_is_valid_access consistent with other is_valid_access
helpers.

Requested-by: Daniel Borkmann [off-list ref]
Signed-off-by: David Ahern <redacted>
---
 net/core/filter.c | 2 --
 1 file changed, 2 deletions(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 9dad3e7e2e10..f9add024d92f 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -3468,9 +3468,7 @@ static bool sock_filter_is_valid_access(int off, int size,
 	if (type == BPF_WRITE) {
 		switch (off) {
 		case offsetof(struct bpf_sock, bound_dev_if):
-			break;
 		case offsetof(struct bpf_sock, mark):
-			break;
 		case offsetof(struct bpf_sock, priority):
 			break;
 		default:
-- 
2.1.4

Re: [PATCH net-next] bpf: Collapse offset checks in sock_filter_is_valid_access

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2017-09-01 15:53:14

On 09/01/2017 05:18 PM, David Ahern wrote:
Make sock_filter_is_valid_access consistent with other is_valid_access
helpers.

Requested-by: Daniel Borkmann [off-list ref]
Signed-off-by: David Ahern <redacted>
Thanks for following up,

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

Re: [PATCH net-next] bpf: Collapse offset checks in sock_filter_is_valid_access

From: Alexei Starovoitov <hidden>
Date: 2017-09-01 16:35:38

On Fri, Sep 01, 2017 at 08:18:07AM -0700, David Ahern wrote:
Make sock_filter_is_valid_access consistent with other is_valid_access
helpers.

Requested-by: Daniel Borkmann [off-list ref]
Signed-off-by: David Ahern <redacted>
Acked-by: Alexei Starovoitov <ast@kernel.org>

Re: [PATCH net-next] bpf: Collapse offset checks in sock_filter_is_valid_access

From: David Miller <davem@davemloft.net>
Date: 2017-09-01 17:37:25

From: David Ahern <redacted>
Date: Fri,  1 Sep 2017 08:18:07 -0700
Make sock_filter_is_valid_access consistent with other is_valid_access
helpers.

Requested-by: Daniel Borkmann [off-list ref]
Signed-off-by: David Ahern <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help