On Mon, Jun 17, 2019 at 06:57PM, Alexei Starovoitov wrote:
> On 6/17/19 9:39 AM, Andrii Nakryiko wrote:
> > On Sat, Jun 15, 2019 at 12:12 PM Alexei Starovoitov wrote:
> >>
> >> v2->v3: fixed issues in backtracking pointed out by Andrii.
> >> The next step is to add a lot more tests for backtrackin
_end) {
4: return ptr <= pkt_end;
5: }
6: if (ret)
7: value = *(u8 *)ctx.pkt;
Signed-off-by: Paul Chaignon
---
tools/testing/selftests/bpf/verifier/calls.c | 25 +++
.../bpf/verifier/direct_packet_access.c | 22
2 files changed, 47 insertions(+)
rn 1;
In the above, mark_ptr_or_null_regs will warn on line 6 because it will
try to free the reference state, even though it was already freed on
line 3.
Fixes: f4d7e40a5b71 ("bpf: introduce function calls (verification)")
Signed-off-by: Paul Chaignon
---
kernel/bpf/v
ecause of the above changes.
Changes in v2:
- Fix example codes in commit message.
Paul Chaignon (2):
bpf: mark registers in all frames after pkt/null checks
selftests/bpf: test cases for pkt/null checks in subprogs
kernel/bpf/verifier.c | 76 +++
On Tue, Apr 23, 2019 01:47AM, Daniel Borkmann wrote:
> On 04/22/2019 08:34 PM, Paul Chaignon wrote:
> > In case of a null check on a pointer inside a subprog, we should mark all
> > registers with this pointer as either safe or unknown, in both the current
> > and previous fra
ed-off-by: Paul Chaignon
---
tools/testing/selftests/bpf/verifier/calls.c | 25
1 file changed, 25 insertions(+)
diff --git a/tools/testing/selftests/bpf/verifier/calls.c
b/tools/testing/selftests/bpf/verifier/calls.c
index fb11240b758b..9093a8f64dc6 100644
--- a/tools/testing/
free the reference state, even though it was already freed on
line 3.
Fixes: f4d7e40a5b71 ("bpf: introduce function calls (verification)")
Signed-off-by: Paul Chaignon
---
kernel/bpf/verifier.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/bpf/verif
bove, mark_ptr_or_null_regs will warn on line 6 because it will
try to free the reference state, even though it was already freed on
line 3.
Changelogs:
Changes in v2:
- Fix example codes in commit message.
Paul Chaignon (2):
bpf: mark registers as safe or unknown in all frames
selftests/bpf:
On Mon, Apr 22, 2019 04:57PM, Yonghong Song wrote:
> On 4/20/19 5:38 AM, Paul Chaignon wrote:
> > In case of a null check on a pointer inside a subprog, we should mark all
> > registers with this pointer as either safe or unknown, in both the current
> > and previous fra
y to free the reference state, even though it was already freed on
line 3.
Fixes: f4d7e40a5b71 ("bpf: introduce function calls (verification)")
Signed-off-by: Paul Chaignon
---
kernel/bpf/verifier.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/bpf/verif
ed-off-by: Paul Chaignon
---
tools/testing/selftests/bpf/verifier/calls.c | 25
1 file changed, 25 insertions(+)
diff --git a/tools/testing/selftests/bpf/verifier/calls.c
b/tools/testing/selftests/bpf/verifier/calls.c
index fb11240b758b..9093a8f64dc6 100644
--- a/tools/testing/
bove, mark_ptr_or_null_regs will warn on line 6 because it will
try to free the reference state, even though it was already freed on
line 3.
Paul Chaignon (2):
bpf: mark registers as safe or unknown in all frames
selftests/bpf: test case for pointer null check in subprog
kernel/bpf/verifi
On Tue, Apr 02, 2019 at 10:39:29AM -0700, Alexei Starovoitov wrote:
> On Tue, Apr 02, 2019 at 04:37:19PM +0200, Daniel Borkmann wrote:
> > On 04/02/2019 01:58 PM, Paul Chaignon wrote:
> > > Three checks for verifier bugs were introduced in commit f4d7e40 ("bpf:
> &g
Three checks for verifier bugs were introduced in commit f4d7e40 ("bpf:
introduce function calls (verification)"). The bugs were reported as
incorrect programs instead of kernel warnings as the present patch
implements.
Signed-off-by: Paul Chaignon
---
kernel/bpf/verif
On Wed, Mar 20, 2019 at 11:31PM, Yonghong Song wrote:
> On 3/20/19 5:57 AM, Paul Chaignon wrote:
> > The BPF verifier checks the maximum number of call stack frames twice,
> > first in the main CFG traversal (do_check) and then in a subsequent
> > traversal (check_max_stack_d
This patch adds a test case with an excessive number of call stack frames
in dead code.
Signed-off-by: Paul Chaignon
Tested-by: Xiao Han
---
tools/testing/selftests/bpf/verifier/calls.c | 38
1 file changed, 38 insertions(+)
diff --git a/tools/testing/selftests/bpf
ion of how invalid dead code should be treated.
This patch implements the conservative option and rejects such code.
Signed-off-by: Paul Chaignon
Tested-by: Xiao Han
---
kernel/bpf/verifier.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/verifier.c b/
ion of how invalid dead code should be treated.
The first patch implements the conservative option and rejects such code;
the second adds a test case.
Paul Chaignon (2):
bpf: remove incorrect 'verifier bug' warning
selftests/bpf: test case for invalid call stack in dead code
k
On 04/23/2018 11:18 PM +0200, Daniel Borkmann wrote:
> On 04/22/2018 11:52 PM, Paul Chaignon wrote:
> > Helpers that expect ARG_PTR_TO_MAP_KEY and ARG_PTR_TO_MAP_VALUE can only
> > access stack and packet memory. Allow these helpers to directly access
> > map values by pass
This patch adds new test cases for accesses to map values from map
helpers.
Signed-off-by: Paul Chaignon
---
tools/testing/selftests/bpf/test_verifier.c | 266
1 file changed, 266 insertions(+)
diff --git a/tools/testing/selftests/bpf/test_verifier.c
b/tools
di);
u64 *count = bpf_map_lookup_elem(&counts, info);
(*count)++;
}
Signed-off-by: Paul Chaignon
---
kernel/bpf/verifier.c | 24 +++-
1 file changed, 7 insertions(+), 17 deletions(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 5dd1dcb..eb1
cases for adjusted maps.
Paul Chaignon (2):
bpf: allow map helpers access to map values directly
tools/bpf: add verifier tests for accesses to map values
kernel/bpf/verifier.c | 24 +--
tools/testing/selftests/bpf/test_verifier.c | 266
2
This patch adds new test cases for accesses to map values from map
helpers.
Signed-off-by: Paul Chaignon
---
tools/testing/selftests/bpf/test_verifier.c | 266
1 file changed, 266 insertions(+)
diff --git a/tools/testing/selftests/bpf/test_verifier.c
b/tools
di);
u64 *count = bpf_map_lookup_elem(&counts, info);
(*count)++;
}
Signed-off-by: Paul Chaignon
---
kernel/bpf/verifier.c | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 5dd1dcb902bf..70e00beade03 100644
.
Previous versions of this patchset were sent on the iovisor-dev mailing
list only.
Changelogs:
Changes in v4:
- Rebase.
Changes in v3:
- Bug fixes.
- Negative test cases.
Changes in v2:
- Additional test cases for adjusted maps.
Paul Chaignon (2):
bpf: allow map helpers
25 matches
Mail list logo