Re: [PATCH net] bpf: disallow arithmetic operations on context pointer

2017-10-16 Thread Jakub Kicinski
On Mon, 16 Oct 2017 17:47:45 +0100, Edward Cree wrote: > On 16/10/17 17:30, Jakub Kicinski wrote: > > On Mon, 16 Oct 2017 17:16:24 +0100, Edward Cree wrote: > >> On 16/10/17 16:45, Jakub Kicinski wrote: > >>> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c > >>> index 8b8d6ba39e23..8

Re: [PATCH net] bpf: disallow arithmetic operations on context pointer

2017-10-16 Thread Edward Cree
On 16/10/17 17:30, Jakub Kicinski wrote: > On Mon, 16 Oct 2017 17:16:24 +0100, Edward Cree wrote: >> On 16/10/17 16:45, Jakub Kicinski wrote: >>> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c >>> index 8b8d6ba39e23..8499759d0c7a 100644 >>> --- a/kernel/bpf/verifier.c >>> +++ b/kernel/b

Re: [PATCH net] bpf: disallow arithmetic operations on context pointer

2017-10-16 Thread Edward Cree
On 16/10/17 16:45, Jakub Kicinski wrote: > Commit f1174f77b50c ("bpf/verifier: rework value tracking") > removed the crafty selection of which pointer types are > allowed to be modified. This is OK for most pointer types > since adjust_ptr_min_max_vals() will catch operations on > immutable pointe

Re: [PATCH net] bpf: disallow arithmetic operations on context pointer

2017-10-16 Thread Jakub Kicinski
On Mon, 16 Oct 2017 17:16:24 +0100, Edward Cree wrote: > On 16/10/17 16:45, Jakub Kicinski wrote: > > Commit f1174f77b50c ("bpf/verifier: rework value tracking") > > removed the crafty selection of which pointer types are > > allowed to be modified. This is OK for most pointer types > > since adju

[PATCH net] bpf: disallow arithmetic operations on context pointer

2017-10-16 Thread Jakub Kicinski
Commit f1174f77b50c ("bpf/verifier: rework value tracking") removed the crafty selection of which pointer types are allowed to be modified. This is OK for most pointer types since adjust_ptr_min_max_vals() will catch operations on immutable pointers. One exception is PTR_TO_CTX which is now allow