ned-off-by: Gary Lin
---
kernel/bpf/verifier.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index cdc43b899f28..0960f65c6da7 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -33,7 +33,7 @@
* - out of bounds or
m log, there was one more jit happened with only
one pass and the same jit code was produced.
Signed-off-by: Gary Lin
---
tools/testing/selftests/bpf/test_verifier.c | 43 +
tools/testing/selftests/bpf/verifier/jit.c | 16
2 files changed, 59 insertions(+)
diff --git a/
With NOPs padding, x64 jit now can handle the jump cases like
bpf_fill_maxinsns11().
Signed-off-by: Gary Lin
---
lib/test_bpf.c | 7 +--
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index ca7d635bccd9..272a9fd143ab 100644
--- a/lib/test_bpf.c
e without padding.
v2:
- Simplify the sample code in the description and provide the jit code
- Check the expected padding bytes with WARN_ONCE
- Move the 'padded' flag to 'struct x64_jit_data'
Signed-off-by: Gary Lin
---
arch/x86/net/bpf_jit_comp.c | 103 +
sample code in the commit description and provide the
jit code
- Check the expected padding bytes with WARN_ONCE
- Move the 'padded' flag to 'struct x64_jit_data'
- Remove the EXPECTED_FAIL flag from bpf_fill_maxinsns11() in test_bpf
- Add 2 verifier tests
Gary L
On Thu, Jan 14, 2021 at 10:37:33PM -0800, Alexei Starovoitov wrote:
> On Thu, Jan 14, 2021 at 1:54 AM Gary Lin wrote:
> > * pass to emit the final image.
> > */
> > - for (pass = 0; pass < 20 || image; pass++) {
> > - progl
On Fri, Jan 15, 2021 at 08:04:06AM -0800, Alexei Starovoitov wrote:
> On Fri, Jan 15, 2021 at 1:41 AM Gary Lin wrote:
> >
> > On Thu, Jan 14, 2021 at 10:37:33PM -0800, Alexei Starovoitov wrote:
> > > On Thu, Jan 14, 2021 at 1:54 AM Gary Lin wrote:
> > > >
ding bytes with WARN_ONCE
- Move the 'padded' flag to 'struct x64_jit_data'
- Remove the EXPECTED_FAIL flag from bpf_fill_maxinsns11() in test_bpf
- Add 2 verifier tests
Gary Lin (3):
bpf,x64: pad NOPs to make images converge more easily
test_bpf: remove EXPECTED
g is always enabled since it won't hurt the images
that converge without padding.
v2:
- Simplify the sample code in the description and provide the jit code
- Check the expected padding bytes with WARN_ONCE
- Move the 'padded' flag to 'struct x64_jit_
the same jit code was produced.
v4:
- Add the second test case which triggers jmp_cond padding and imm32 nop
jmp padding.
- Add the new test case as another subprog
Signed-off-by: Gary Lin
---
tools/testing/selftests/bpf/test_verifier.c | 72 +
tools/testing/selftests/
With NOPs padding, x64 jit now can handle the jump cases like
bpf_fill_maxinsns11().
Signed-off-by: Gary Lin
---
lib/test_bpf.c | 7 +--
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index 49ec9e8d8aed..4dc4dcbecd12 100644
--- a/lib/test_bpf.c
oduced to 'struct bpf_prog'
so that bpf_int_jit_compile() could know if the program is padded or not.
Signed-off-by: Gary Lin
---
arch/x86/net/bpf_jit_comp.c | 68 -
include/linux/filter.h | 1 +
2 files changed, 45 insertions(+), 24 deletions(-)
diff -
On Fri, Dec 11, 2020 at 12:58:17PM -0800, Andrii Nakryiko wrote:
> On Fri, Dec 11, 2020 at 8:51 AM Gary Lin wrote:
> >
> > The x64 bpf jit expects bpf images converge within the given passes, but
> > it could fail to do so with some corner cases. For example:
> &g
On Fri, Dec 11, 2020 at 09:05:05PM +0100, Daniel Borkmann wrote:
> On 12/11/20 9:19 AM, Gary Lin wrote:
> > The x64 bpf jit expects bpf images converge within the given passes, but
> > it could fail to do so with some corner cases. For example:
> >
> >l0
icky bits
> of the prog structure.
> It's only needed between the last pass and extra pass for bpf2bpf calls.
> I think it would be cleaner to keep it in struct x64_jit_data *jit_data.
>
Okay, jit_data is surely a better place for the flag.
> As others have said the selftests are must have.
> Especially for bpf2bpf calls where one subprog is padded.
>
Will try to craft some test cases for this patch in v2.
Gary Lin
On Mon, Dec 14, 2020 at 11:56:22AM +0800, Gary Lin wrote:
> On Fri, Dec 11, 2020 at 09:05:05PM +0100, Daniel Borkmann wrote:
> > On 12/11/20 9:19 AM, Gary Lin wrote:
> > > The x64 bpf jit expects bpf images converge within the given passes, but
> > > it could fail to d
On Mon, Dec 14, 2020 at 04:31:44PM +0100, Daniel Borkmann wrote:
> On 12/14/20 9:15 AM, Gary Lin wrote:
> > On Mon, Dec 14, 2020 at 11:56:22AM +0800, Gary Lin wrote:
> > > On Fri, Dec 11, 2020 at 09:05:05PM +0100, Daniel Borkmann wrote:
> > > > On 12/11/20 9:19 AM,
'padded' flag to 'struct x64_jit_data'
- Remove the EXPECTED_FAIL flag from bpf_fill_maxinsns11() in test_bpf
- Add 2 verifier tests
Gary Lin (3):
bpf,x64: pad NOPs to make images converge more easily
test_bpf: remove EXPECTED_FAIL flag from bpf_fill_maxinsns11
selftes
With NOPs padding, x64 jit now can handle the jump cases like
bpf_fill_maxinsns11().
Signed-off-by: Gary Lin
---
lib/test_bpf.c | 7 +--
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index ca7d635bccd9..272a9fd143ab 100644
--- a/lib/test_bpf.c
m log, there was one more jit happened with only
one pass and the same jit code was produced.
Signed-off-by: Gary Lin
---
tools/testing/selftests/bpf/test_verifier.c | 43 +
tools/testing/selftests/bpf/verifier/jit.c | 16
2 files changed, 59 insertions(+)
diff --git a/
padding bytes with WARN_ONCE
- Move the 'padded' flag to 'struct x64_jit_data'
Signed-off-by: Gary Lin
---
arch/x86/net/bpf_jit_comp.c | 86 ++---
1 file changed, 62 insertions(+), 24 deletions(-)
diff --git a/arch/x86/net/bpf_jit_comp.c
igned-off-by: Gary Lin
---
net/bpfilter/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bpfilter/main.c b/net/bpfilter/main.c
index 61ce8454a88e..77396a098fbe 100644
--- a/net/bpfilter/main.c
+++ b/net/bpfilter/main.c
@@ -55,7 +55,7 @@ static void loop(void)
int
ed and a warning is issued to notify the user.
Signed-off-by: Gary Lin
---
arch/x86/net/bpf_jit_comp.c | 47 +
1 file changed, 37 insertions(+), 10 deletions(-)
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 796506dcfc42..6fe933e9
On Thu, Nov 26, 2020 at 04:01:30PM +0800, Gary Lin wrote:
> The x64 bpf jit expects bpf images converge within the given passes, but
> it could fail to do so with some corner cases. For example:
>
> l0: ldh [4]
> l1: jeq #0x537d, l2, l40
> l2:
ed to avoid the further jump offset changes.
Due to the fact that the images are not optimized after the extra
passes, a warning is issued to notify the user, but at least the images
are allocated and ready to run.
Signed-off-by: Gary Lin
---
arch/x86/net/bpf_jit_comp.c | 35
o be small. To avoid increasing
the complexity of BPF JIT, this commit just bumps the number of passes
to 64 as suggested by Daniel to make it less likely to fail on such cases.
Signed-off-by: Gary Lin
---
arch/x86/net/bpf_jit_comp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arc
On Thu, Dec 03, 2020 at 10:14:31AM -0800, Alexei Starovoitov wrote:
> On Thu, Dec 03, 2020 at 12:20:38PM +0100, Eric Dumazet wrote:
> >
> >
> > On 12/3/20 10:12 AM, Gary Lin wrote:
> > > The x64 bpf jit expects bpf images converge within the given passes, but
>
On Fri, Dec 04, 2020 at 11:42:13AM +0800, Gary Lin wrote:
> On Thu, Dec 03, 2020 at 10:14:31AM -0800, Alexei Starovoitov wrote:
> > On Thu, Dec 03, 2020 at 12:20:38PM +0100, Eric Dumazet wrote:
> > >
> > >
> > > On 12/3/20 10:12 AM, Gary Lin wrote:
> &
'padded' flag to 'struct x64_jit_data'
- Remove the EXPECTED_FAIL flag from bpf_fill_maxinsns11() in test_bpf
- Add 2 verifier tests
Gary Lin (3):
bpf,x64: pad NOPs to make images converge more easily
test_bpf: remove EXPECTED_FAIL flag from bpf_fill_maxinsns11
selftes
padding bytes with WARN_ONCE
- Move the 'padded' flag to 'struct x64_jit_data'
Signed-off-by: Gary Lin
---
arch/x86/net/bpf_jit_comp.c | 86 ++---
1 file changed, 62 insertions(+), 24 deletions(-)
diff --git a/arch/x86/net/bpf_jit_comp.c
m log, there was one more jit happened with only
one pass and the same jit code was produced.
Signed-off-by: Gary Lin
---
tools/testing/selftests/bpf/test_verifier.c | 43 +
tools/testing/selftests/bpf/verifier/jit.c | 16
2 files changed, 59 insertions(+)
diff --git a/
With NOPs padding, x64 jit now can handle the jump cases like
bpf_fill_maxinsns11().
Signed-off-by: Gary Lin
---
lib/test_bpf.c | 7 +--
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index ca7d635bccd9..272a9fd143ab 100644
--- a/lib/test_bpf.c
On Fri, Jan 08, 2021 at 11:21:13PM +0100, Daniel Borkmann wrote:
> On 1/7/21 3:16 AM, Gary Lin wrote:
> > The x64 bpf jit expects bpf images converge within the given passes, but
> > it could fail to do so with some corner cases. For example:
> >
> >l0: ja
eserves a document to collect the corner cases so that the user could
know the limitations and how to work around them.
Signed-off-by: Gary Lin
---
arch/x86/net/bpf_jit_comp.c | 13 -
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x
On Fri, Nov 13, 2020 at 05:48:31PM -0800, Alexei Starovoitov wrote:
> On Fri, Nov 13, 2020 at 12:40 AM Gary Lin wrote:
> >
> > The x64 bpf jit expects the bpf images converge within the given passes.
> > However there is a corner case:
> >
> > l0: ldh [4]
&
35 matches
Mail list logo