Re: [PATCH v2 6/7] bpf: Make use of alignment information in check_val_ptr_alignment().

2017-05-11 Thread Daniel Borkmann
On 05/11/2017 07:23 PM, David Miller wrote: From: Daniel Borkmann Date: Thu, 11 May 2017 18:49:45 +0200 This actually won't work, see also commit 79adffcd6489 ("bpf, verifier: fix rejection of unaligned access checks for map_value_adj") with some longer explanation. In case of map_value_adj, r

Re: [PATCH v2 6/7] bpf: Make use of alignment information in check_val_ptr_alignment().

2017-05-11 Thread David Miller
From: Daniel Borkmann Date: Thu, 11 May 2017 18:49:45 +0200 > This actually won't work, see also commit 79adffcd6489 ("bpf, > verifier: > fix rejection of unaligned access checks for map_value_adj") with some > longer explanation. In case of map_value_adj, reg->id is always 0. I see Ok if I

Re: [PATCH v2 6/7] bpf: Make use of alignment information in check_val_ptr_alignment().

2017-05-11 Thread Daniel Borkmann
On 05/11/2017 06:06 PM, David Miller wrote: We can validate PTR_TO_MAP_VALUE_ADJ accesses in the same way that we do for PTR_TO_PACKET. The only difference is that we don't plug NET_IP_ALIGN into the equation. Signed-off-by: David S. Miller --- kernel/bpf/verifier.c | 25 +++

[PATCH v2 6/7] bpf: Make use of alignment information in check_val_ptr_alignment().

2017-05-11 Thread David Miller
We can validate PTR_TO_MAP_VALUE_ADJ accesses in the same way that we do for PTR_TO_PACKET. The only difference is that we don't plug NET_IP_ALIGN into the equation. Signed-off-by: David S. Miller --- kernel/bpf/verifier.c | 25 + 1 file changed, 21 insertions(+), 4 del