Neat! :) I had a look at mostly the "high level" part (fprobe and
arm64 specific bits) and this seems to be in a good state to me.
Thanks for all that work, that is quite a refactoring :)
On Mon, Apr 15, 2024 at 2:49 PM Masami Hiramatsu (Google)
wrote:
>
> Hi,
>
> Here is the 9th version of the
On Wed, Apr 24, 2024 at 2:23 PM Florent Revest wrote:
>
> On Mon, Apr 15, 2024 at 2:49 PM Masami Hiramatsu (Google)
> wrote:
> >
> > From: Masami Hiramatsu (Google)
> >
> > To clarify what will be expected on ftrace_regs, add a comment to the
> > arc
On Mon, Apr 15, 2024 at 2:49 PM Masami Hiramatsu (Google)
wrote:
>
> From: Masami Hiramatsu (Google)
>
> To clarify what will be expected on ftrace_regs, add a comment to the
> architecture independent definition of the ftrace_regs.
>
> Signed-off-by: Masami Hiramatsu (Google)
> Acked-by: Mark R
On Tue, Apr 20, 2021 at 12:54 AM Alexei Starovoitov
wrote:
>
> On Mon, Apr 19, 2021 at 05:52:39PM +0200, Florent Revest wrote:
> > This type provides the guarantee that an argument is going to be a const
> > pointer to somewhere in a read-only map value. It also checks that t
On Mon, Apr 19, 2021 at 9:34 PM Andrii Nakryiko
wrote:
>
> On Mon, Apr 19, 2021 at 8:52 AM Florent Revest wrote:
> >
> > We have a usecase where we want to audit symbol names (if available) in
> > callback registration hooks. (ex: fentry/nf_register_net_hook)
>
symbols.
The implementation is also moved from bpf_trace.c to helpers.c because
the upcoming bpf_snprintf helper will be made available to all BPF
programs and will need it.
Signed-off-by: Florent Revest
---
include/linux/bpf.h | 20 +++
kernel/bpf/helpers.c | 256
The "positive" part tests all format specifiers when things go well.
The "negative" part makes sure that incorrect format strings fail at
load time.
Signed-off-by: Florent Revest
---
.../selftests/bpf/prog_tests/snprintf.c | 125 ++
.../selftests/bpf/p
ss of format string validation in the verifier logic. This
makes debugging easier.
Signed-off-by: Florent Revest
Acked-by: Andrii Nakryiko
---
include/linux/bpf.h| 1 +
include/uapi/linux/bpf.h | 28 +++
kernel/bpf/helpers.c
Similarly to BPF_SEQ_PRINTF, this macro turns variadic arguments into an
array of u64, making it more natural to call the bpf_snprintf helper.
Signed-off-by: Florent Revest
Acked-by: Andrii Nakryiko
---
tools/lib/bpf/bpf_tracing.h | 18 ++
1 file changed, 18 insertions(+)
diff
: Add bpf_iter support")
Signed-off-by: Florent Revest
Acked-by: Andrii Nakryiko
---
tools/lib/bpf/bpf_tracing.h | 40 +++--
1 file changed, 29 insertions(+), 11 deletions(-)
diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h
index f9
This type provides the guarantee that an argument is going to be a const
pointer to somewhere in a read-only map value. It also checks that this
pointer is followed by a zero character before the end of the map value.
Signed-off-by: Florent Revest
Acked-by: Andrii Nakryiko
---
include/linux
ssed a few cosmetic changes
Florent Revest (6):
bpf: Factorize bpf_trace_printk and bpf_seq_printf
bpf: Add a ARG_PTR_TO_CONST_STR argument type
bpf: Add a bpf_snprintf helper
libbpf: Initialize the bpf_seq_printf parameters array field by field
libbpf: Introduce a BPF_SNPRINTF he
On Fri, Apr 16, 2021 at 1:20 AM Andrii Nakryiko
wrote:
>
> On Wed, Apr 14, 2021 at 11:54 AM Florent Revest wrote:
> > +/* Loads an eBPF object calling bpf_snprintf with up to 10 characters of
> > fmt */
> > +static int load_single_snprintf(char *fmt)
&
On Thu, Apr 15, 2021 at 12:16 AM Andrii Nakryiko
wrote:
>
> On Wed, Apr 14, 2021 at 2:21 AM Florent Revest wrote:
> >
> > On Wed, Apr 14, 2021 at 1:21 AM Andrii Nakryiko
> > wrote:
> > >
> > > On Mon, Apr 12, 2021 at 8:38 AM Florent Revest
> >
On Thu, Apr 15, 2021 at 12:57 AM Andrii Nakryiko
wrote:
>
> On Wed, Apr 14, 2021 at 2:46 AM Florent Revest wrote:
> >
> > On Wed, Apr 14, 2021 at 1:16 AM Andrii Nakryiko
> > wrote:
> > > On Mon, Apr 12, 2021 at 8:38 AM Florent Revest
> > > wrote
On Thu, Apr 15, 2021 at 2:38 AM Andrii Nakryiko
wrote:
> On Wed, Apr 14, 2021 at 11:54 AM Florent Revest wrote:
> > +static int try_get_fmt_tmp_buf(char **tmp_buf)
> > +{
> > + struct bpf_printf_buf *bufs;
> > + int used;
> > +
> > + if
On Thu, Apr 15, 2021 at 2:28 AM Andrii Nakryiko
wrote:
> On Wed, Apr 14, 2021 at 11:58 AM Martin KaFai Lau wrote:
> > On Wed, Apr 14, 2021 at 05:56:32PM +0200, Florent Revest wrote:
> > > It is just missing a ';'. This macro is not used by any test yet.
> > >
: Add bpf_iter support")
Signed-off-by: Florent Revest
Acked-by: Andrii Nakryiko
---
tools/lib/bpf/bpf_tracing.h | 40 +++--
1 file changed, 29 insertions(+), 11 deletions(-)
diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h
index f9
The "positive" part tests all format specifiers when things go well.
The "negative" part makes sure that incorrect format strings fail at
load time.
Signed-off-by: Florent Revest
---
.../selftests/bpf/prog_tests/snprintf.c | 124 ++
.../selftests/bpf/p
Similarly to BPF_SEQ_PRINTF, this macro turns variadic arguments into an
array of u64, making it more natural to call the bpf_snprintf helper.
Signed-off-by: Florent Revest
Acked-by: Andrii Nakryiko
---
tools/lib/bpf/bpf_tracing.h | 18 ++
1 file changed, 18 insertions(+)
diff
ss of format string validation in the verifier logic. This
makes debugging easier.
Signed-off-by: Florent Revest
---
include/linux/bpf.h| 1 +
include/uapi/linux/bpf.h | 28 +++
kernel/bpf/helpers.c | 50 ++
kernel/bpf/verif
This type provides the guarantee that an argument is going to be a const
pointer to somewhere in a read-only map value. It also checks that this
pointer is followed by a zero character before the end of the map value.
Signed-off-by: Florent Revest
Acked-by: Andrii Nakryiko
---
include/linux
symbols.
The implementation is also moved from bpf_trace.c to helpers.c because
the upcoming bpf_snprintf helper will be made available to all BPF
programs and will need it.
Signed-off-by: Florent Revest
---
include/linux/bpf.h | 20 +++
kernel/bpf/helpers.c | 254
types
- We now preempt_disable when using a per-cpu temporary buffer
- Addressed a few cosmetic changes
Florent Revest (6):
bpf: Factorize bpf_trace_printk and bpf_seq_printf
bpf: Add a ARG_PTR_TO_CONST_STR argument type
bpf: Add a bpf_snprintf helper
libbpf: Initialize the bpf_seq_printf
Hey Geert! :)
On Wed, Apr 14, 2021 at 8:02 PM Geert Uytterhoeven wrote:
> On Wed, Apr 14, 2021 at 9:41 AM Andrii Nakryiko
> wrote:
> > On Mon, Apr 12, 2021 at 8:38 AM Florent Revest wrote:
> > > + fmt = (char *)fmt_addr + fmt_map_off;
> > > +
> >
&g
It is just missing a ';'. This macro is not used by any test yet.
Signed-off-by: Florent Revest
---
tools/testing/selftests/bpf/test_progs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/test_progs.h
b/tools/testing/selftests/bpf/te
On Mon, Apr 12, 2021 at 10:32 PM kernel test robot wrote:
>m68k-linux-ld: kernel/bpf/verifier.o: in function
> `check_helper_call.isra.0':
> >> verifier.c:(.text+0xf79e): undefined reference to `bpf_printf_prepare'
>m68k-linux-ld: kernel/bpf/helpers.o: in function `bpf_base_func_proto':
>
On Wed, Apr 14, 2021 at 11:56 AM Florent Revest wrote:
> On Wed, Apr 14, 2021 at 1:01 AM Andrii Nakryiko
> wrote:
> > On Mon, Apr 12, 2021 at 8:38 AM Florent Revest wrote:
> > > + err = 0;
> > > +out:
> > > + put_fmt_tmp_buf();
> >
&
On Wed, Apr 14, 2021 at 1:01 AM Andrii Nakryiko
wrote:
> On Mon, Apr 12, 2021 at 8:38 AM Florent Revest wrote:
> > +/* Per-cpu temp buffers which can be used by printf-like helpers for %s or
> > %p
> > + */
> > +#define MAX_PRINTF_BUF_LEN 512
>
On Wed, Apr 14, 2021 at 1:16 AM Andrii Nakryiko
wrote:
> On Mon, Apr 12, 2021 at 8:38 AM Florent Revest wrote:
> > +static int check_bpf_snprintf_call(struct bpf_verifier_env *env,
> > + struct bpf_reg_state *regs)
> > +{
> > + st
On Wed, Apr 14, 2021 at 1:21 AM Andrii Nakryiko
wrote:
>
> On Mon, Apr 12, 2021 at 8:38 AM Florent Revest wrote:
> >
> > This exercises most of the format specifiers.
> >
> > Signed-off-by: Florent Revest
> > Acked-by: Andrii Nakryiko
> > ---
>
&
: Add bpf_iter support")
Signed-off-by: Florent Revest
---
tools/lib/bpf/bpf_tracing.h | 40 +++--
1 file changed, 29 insertions(+), 11 deletions(-)
diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h
index f9ef37707888..1c2e91ee041d 100644
--- a
lpers.
- bpf_snprintf's str_size can now be 0
- bpf_snprintf is now exposed to all BPF program types
- We now preempt_disable when using a per-cpu temporary buffer
- Addressed a few cosmetic changes
Florent Revest (6):
bpf: Factorize bpf_trace_printk and bpf_seq_printf
bpf: Add a ARG_PTR_TO
Similarly to BPF_SEQ_PRINTF, this macro turns variadic arguments into an
array of u64, making it more natural to call the bpf_snprintf helper.
Signed-off-by: Florent Revest
---
tools/lib/bpf/bpf_tracing.h | 18 ++
1 file changed, 18 insertions(+)
diff --git a/tools/lib/bpf
This exercises most of the format specifiers.
Signed-off-by: Florent Revest
Acked-by: Andrii Nakryiko
---
.../selftests/bpf/prog_tests/snprintf.c | 81 +++
.../selftests/bpf/progs/test_snprintf.c | 74 +
2 files changed, 155 insertions(+)
create
symbols.
Signed-off-by: Florent Revest
---
kernel/trace/bpf_trace.c | 529 ++-
1 file changed, 248 insertions(+), 281 deletions(-)
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 0d23755c2747..3ce9aeee6681 100644
--- a/kernel/trace
ss of format string validation in the verifier logic. This
makes debugging easier.
Signed-off-by: Florent Revest
---
include/linux/bpf.h| 6
include/uapi/linux/bpf.h | 28 +++
kernel/bpf/helpers.c | 2 ++
kernel/bpf/verifier.c
This type provides the guarantee that an argument is going to be a const
pointer to somewhere in a read-only map value. It also checks that this
pointer is followed by a zero character before the end of the map value.
Signed-off-by: Florent Revest
---
include/linux/bpf.h | 1 +
kernel/bpf
On Wed, Apr 7, 2021 at 11:54 PM Andrii Nakryiko
wrote:
> On Tue, Apr 6, 2021 at 8:35 AM Florent Revest wrote:
> > On Fri, Mar 26, 2021 at 11:51 PM Andrii Nakryiko
> > wrote:
> > > On Fri, Mar 26, 2021 at 2:53 PM Andrii Nakryiko
> > > wrote:
> > >
On Thu, Apr 8, 2021 at 12:03 AM Andrii Nakryiko
wrote:
> On Tue, Apr 6, 2021 at 9:06 AM Florent Revest wrote:
> > On Fri, Mar 26, 2021 at 11:55 PM Andrii Nakryiko
> > wrote:
> > > On Tue, Mar 23, 2021 at 7:23 PM Florent Revest
> > > wrote:
> > > >
On Fri, Mar 26, 2021 at 11:55 PM Andrii Nakryiko
wrote:
> On Tue, Mar 23, 2021 at 7:23 PM Florent Revest wrote:
> > The implementation takes inspiration from the existing bpf_trace_printk
> > helper but there are a few differences:
> >
> > To allow for a large
On Sat, Mar 27, 2021 at 12:01 AM Andrii Nakryiko
wrote:
>
> On Tue, Mar 23, 2021 at 7:23 PM Florent Revest wrote:
> >
> > When initializing the __param array with a one liner, if all args are
> > const, the initial array value will be placed in the rodata section but
>
On Sat, Mar 27, 2021 at 12:05 AM Andrii Nakryiko
wrote:
>
> On Tue, Mar 23, 2021 at 7:23 PM Florent Revest wrote:
> >
> > This exercises most of the format specifiers when things go well.
> >
> > Signed-off-by: Florent Revest
> > ---
>
> Looks good.
On Fri, Mar 26, 2021 at 11:23 PM Andrii Nakryiko
wrote:
> On Tue, Mar 23, 2021 at 7:23 PM Florent Revest wrote:
> > +
> > + map_off = reg->off + reg->var_off.value;
> > + err = map->ops->map_direct_value_addr(map, &map_addr,
>
[Sorry for the late replies, I'm just back from a long easter break :)]
On Fri, Mar 26, 2021 at 11:51 PM Andrii Nakryiko
wrote:
> On Fri, Mar 26, 2021 at 2:53 PM Andrii Nakryiko
> wrote:
> > On Tue, Mar 23, 2021 at 7:23 PM Florent Revest wrote:
> > > Unfortunately,
: Add bpf_iter support")
Signed-off-by: Florent Revest
---
tools/lib/bpf/bpf_tracing.h | 26 ++
1 file changed, 22 insertions(+), 4 deletions(-)
diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h
index f9ef37707888..d9a4c3f77ff4 100644
--- a/too
This type provides the guarantee that an argument is going to be a const
pointer to somewhere in a read-only map value. It also checks that this
pointer is followed by a zero character before the end of the map value.
Signed-off-by: Florent Revest
---
include/linux/bpf.h | 1 +
kernel/bpf
This exercises most of the format specifiers when things go well.
Signed-off-by: Florent Revest
---
.../selftests/bpf/prog_tests/snprintf.c | 65 +++
.../selftests/bpf/progs/test_snprintf.c | 59 +
2 files changed, 124 insertions(+)
create mode
Similarly to BPF_SEQ_PRINTF, this macro turns variadic arguments into an
array of u64, making it more natural to call the bpf_snprintf helper.
Signed-off-by: Florent Revest
---
tools/lib/bpf/bpf_tracing.h | 18 ++
1 file changed, 18 insertions(+)
diff --git a/tools/lib/bpf
ormat string validation, currently done in formatting
helper calls, into the verifier logic. This makes debugging easier and
also slightly improves the runtime performance.
Signed-off-by: Florent Revest
---
include/linux/bpf.h| 6
include/uapi/linux/bpf.h
ing a per-cpu temporary buffer
- Addressed a few cosmetic changes
Florent Revest (6):
bpf: Factorize bpf_trace_printk and bpf_seq_printf
bpf: Add a ARG_PTR_TO_CONST_STR argument type
bpf: Add a bpf_snprintf helper
libbpf: Initialize the bpf_seq_printf parameters array field by field
l
specifiers to print symbols.
Signed-off-by: Florent Revest
---
kernel/trace/bpf_trace.c | 529 ++-
1 file changed, 244 insertions(+), 285 deletions(-)
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index 0d23755c2747..0fdca94a3c9c 100644
--- a
On Tue, Mar 23, 2021 at 4:21 AM Alexei Starovoitov
wrote:
>
> On Wed, Mar 10, 2021 at 11:02:08PM +0100, Florent Revest wrote:
> >
> > +struct bpf_snprintf_buf {
> > + char buf[MAX_SNPRINTF_MEMCPY][MAX_SNPRINTF_STR_LEN];
> > +};
> > +static DE
On Wed, Mar 17, 2021 at 2:02 AM Andrii Nakryiko
wrote:
> On Tue, Mar 16, 2021 at 5:46 PM Florent Revest wrote:
> > On Wed, Mar 17, 2021 at 1:35 AM Andrii Nakryiko
> > wrote:
> > > On Tue, Mar 16, 2021 at 4:58 PM Florent Revest
> > > wrote:
> > >
On Wed, Mar 17, 2021 at 1:35 AM Andrii Nakryiko
wrote:
> On Tue, Mar 16, 2021 at 4:58 PM Florent Revest wrote:
> > On Tue, Mar 16, 2021 at 2:03 AM Andrii Nakryiko
> > wrote:
> > > On Wed, Mar 10, 2021 at 2:02 PM Florent Revest
> > > wrote:
&g
On Tue, Mar 16, 2021 at 2:03 AM Andrii Nakryiko
wrote:
> On Wed, Mar 10, 2021 at 2:02 PM Florent Revest wrote:
> > + } else if (arg_type == ARG_PTR_TO_CONST_STR) {
> > + struct bpf_map *map = reg->map_ptr;
> > + int map_off, i;
> >
On Tue, Mar 16, 2021 at 5:36 AM Andrii Nakryiko
wrote:
> On Wed, Mar 10, 2021 at 2:02 PM Florent Revest wrote:
> > +#define ___bpf_build_param0(narg, x)
> > +#define ___bpf_build_param1(narg, x) ___param[narg - 1] = x
> > +#define ___bpf_build_param2(narg, x, args...) _
On Tue, Mar 16, 2021 at 2:25 AM Andrii Nakryiko
wrote:
>
> On Wed, Mar 10, 2021 at 2:02 PM Florent Revest wrote:
> >
> > The implementation takes inspiration from the existing bpf_trace_printk
> > helper but there are a few differences:
> >
> > To allow for
On Wed, Mar 10, 2021 at 10:51 PM Andrii Nakryiko
wrote:
> On Wed, Mar 10, 2021 at 12:12 PM Andrii Nakryiko
> wrote:
> > On Wed, Mar 10, 2021 at 8:59 AM Yonghong Song wrote:
> > > On 3/10/21 3:48 AM, Florent Revest wrote:
> > > > On Wed, Mar 10, 2021 at 6:16 AM
This exercices most of the format specifiers when things go well.
Signed-off-by: Florent Revest
---
.../selftests/bpf/prog_tests/snprintf.c | 71 +++
.../selftests/bpf/progs/test_snprintf.c | 71 +++
2 files changed, 142 insertions(+)
create mode
/20210310015455.1095207-1-rev...@chromium.org/T/#u
Florent Revest (5):
bpf: Add a ARG_PTR_TO_CONST_STR argument type
bpf: Add a bpf_snprintf helper
libbpf: Initialize the bpf_seq_printf parameters array field by field
libbpf: Introduce a BPF_SNPRINTF helper macro
selftests/bpf: Add a series of
ormat string validation, currently done in formatting
helper calls, into the verifier logic. This makes debugging easier and
also slightly improves the runtime performance.
Signed-off-by: Florent Revest
---
include/linux/bpf.h| 4 +
include/uapi/linux/bpf.h | 28 +++
kerne
Similarly to BPF_SEQ_PRINTF, this macro turns variadic arguments into an
array of u64, making it more natural to call the bpf_snprintf helper.
Signed-off-by: Florent Revest
---
tools/lib/bpf/bpf_tracing.h | 15 +++
1 file changed, 15 insertions(+)
diff --git a/tools/lib/bpf
This type provides the guarantee that an argument is going to be a const
pointer to somewhere in a read-only map value. It also checks that this
pointer is followed by a NULL character before the end of the map value.
Signed-off-by: Florent Revest
---
include/linux/bpf.h | 1 +
kernel/bpf
relocation should be supported
by libbpf but this would require a disproportionate amount of work given
the actual usecases. (it is very unlikely that one uses a const array of
relocated addresses)
Signed-off-by: Florent Revest
---
tools/lib/bpf/bpf_tracing.h | 30 +-
1 file
On Wed, Mar 10, 2021 at 6:16 AM Yonghong Song wrote:
> On 3/9/21 7:43 PM, Yonghong Song wrote:
> > On 3/9/21 5:54 PM, Florent Revest wrote:
> >> I noticed that initializing an array of pointers using this syntax:
> >> __u64 array[] = { (__u64)&var1, (__u64)&var
= str1=STR1
str2=STR2 ' != expected 'str1=STR1 str2=STR2 str1=STR1 str2=STR2 '
Signed-off-by: Florent Revest
---
tools/testing/selftests/bpf/prog_tests/bug.c | 41 +++
tools/testing/selftests/bpf/progs/test_bug.c | 43
2 files changed,
On Wed, Feb 10, 2021 at 8:52 PM Andrii Nakryiko
wrote:
>
> On Wed, Feb 10, 2021 at 3:14 AM Florent Revest wrote:
> >
> > This needs a new helper that:
> > - can work in a sleepable context (using sock_gen_cookie)
> > - takes a struct sock pointer and checks that it
storage with 0xFF, this uses both an update_cookie_sockops program and
an update_cookie_tracing program which succesively tag the socket with
0x0F and then 0xF0.
Signed-off-by: Florent Revest
Acked-by: KP Singh
---
.../selftests/bpf/prog_tests/socket_cookie.c | 11 --
.../selftests/bpf/progs
fore,
we need to extract ctx->sk in a variable before checking and
dereferencing it.
Acked-by: KP Singh
Acked-by: Andrii Nakryiko
Signed-off-by: Florent Revest
---
.../testing/selftests/bpf/progs/socket_cookie_prog.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --
This needs a new helper that:
- can work in a sleepable context (using sock_gen_cookie)
- takes a struct sock pointer and checks that it's not NULL
Signed-off-by: Florent Revest
Acked-by: KP Singh
---
include/linux/bpf.h| 1 +
include/uapi/linux/bpf.h | 8
k
etons
- rewriting the server/client code with network helpers
- rewriting the cgroup code with test__join_cgroup
- rewriting the error handling code with CHECKs
Signed-off-by: Florent Revest
Acked-by: KP Singh
Acked-by: Andrii Nakryiko
---
tools/testing/selftests/bpf/.gitignore| 1 -
tools/te
rted-by: Daniel Borkmann
Signed-off-by: Florent Revest
Acked-by: KP Singh
---
include/uapi/linux/bpf.h | 8
tools/include/uapi/linux/bpf.h | 8
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index c001766adcb
On Mon, Feb 1, 2021 at 11:37 PM Alexei Starovoitov
wrote:
>
> On Mon, Feb 1, 2021 at 2:32 PM Daniel Borkmann wrote:
> >
> > On 1/30/21 12:45 PM, Florent Revest wrote:
> > > On Fri, Jan 29, 2021 at 1:49 PM Daniel Borkmann
> > > wrote:
> > >
On Fri, Jan 29, 2021 at 1:49 PM Daniel Borkmann wrote:
>
> On 1/29/21 11:57 AM, Daniel Borkmann wrote:
> > On 1/27/21 10:01 PM, Andrii Nakryiko wrote:
> >> On Tue, Jan 26, 2021 at 10:36 AM Florent Revest
> >> wrote:
> >>>
> >>> This ne
On Wed, Jan 27, 2021 at 10:01 PM Andrii Nakryiko
wrote:
>
> On Tue, Jan 26, 2021 at 10:36 AM Florent Revest wrote:
> >
> > This needs a new helper that:
> > - can work in a sleepable context (using sock_gen_cookie)
> > - takes a struct sock pointer and checks tha
fore,
we need to extract ctx->sk in a variable before checking and
dereferencing it.
Acked-by: KP Singh
Signed-off-by: Florent Revest
---
.../testing/selftests/bpf/progs/socket_cookie_prog.c | 11 ++-
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/tools/testing/
storage with 0xFF, this uses both an update_cookie_sockops program and
an update_cookie_tracing program which succesively tag the socket with
0x0F and then 0xF0.
Signed-off-by: Florent Revest
Acked-by: KP Singh
---
.../selftests/bpf/prog_tests/socket_cookie.c | 11 --
.../selftests/bpf/progs
etons
- rewriting the server/client code with network helpers
- rewriting the cgroup code with test__join_cgroup
- rewriting the error handling code with CHECKs
Signed-off-by: Florent Revest
Acked-by: KP Singh
---
tools/testing/selftests/bpf/.gitignore| 1 -
tools/testing/selftests/bpf/Mak
This needs a new helper that:
- can work in a sleepable context (using sock_gen_cookie)
- takes a struct sock pointer and checks that it's not NULL
Signed-off-by: Florent Revest
Acked-by: KP Singh
---
include/linux/bpf.h| 1 +
include/uapi/linux/bpf.h | 8
k
rted-by: Daniel Borkmann
Signed-off-by: Florent Revest
Acked-by: KP Singh
---
include/uapi/linux/bpf.h | 8
tools/include/uapi/linux/bpf.h | 8
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index c001766adcb
On Sat, Jan 23, 2021 at 9:45 PM Yonghong Song wrote:
> On 1/22/21 7:34 AM, Florent Revest wrote:
> > On Wed, Jan 20, 2021 at 8:06 PM Florent Revest wrote:
> >>
> >> On Wed, Jan 20, 2021 at 8:04 PM Alexei Starovoitov
> >> wrote:
> >>>
>
On Wed, Jan 20, 2021 at 8:06 PM Florent Revest wrote:
>
> On Wed, Jan 20, 2021 at 8:04 PM Alexei Starovoitov
> wrote:
> >
> > On Wed, Jan 20, 2021 at 9:08 AM KP Singh wrote:
> > >
> > > On Tue, Jan 19, 2021 at 5:00 PM Florent Revest
> > > wrote
On Thu, Jan 21, 2021 at 8:55 AM Andrii Nakryiko
wrote:
>
> On Tue, Jan 19, 2021 at 8:00 AM Florent Revest wrote:
> >
> > Currently, the selftest for the BPF socket_cookie helpers is built and
> > run independently from test_progs. It's easy to forget and hard to
>
On Wed, Jan 20, 2021 at 8:04 PM Alexei Starovoitov
wrote:
>
> On Wed, Jan 20, 2021 at 9:08 AM KP Singh wrote:
> >
> > On Tue, Jan 19, 2021 at 5:00 PM Florent Revest wrote:
> > >
> > > This builds up on the existing socket cookie test which checks whether
>
On Wed, Dec 9, 2020 at 5:35 PM Daniel Borkmann wrote:
>
> On 12/9/20 2:26 PM, Florent Revest wrote:
> > This needs two new helpers, one that works in a sleepable context (using
> > sock_gen_cookie which disables/enables preemption) and one that does not
> > (for performan
etons
- rewriting the server/client code with network helpers
- rewriting the cgroup code with test__join_cgroup
- rewriting the error handling code with CHECKs
Signed-off-by: Florent Revest
---
tools/testing/selftests/bpf/Makefile | 3 +-
.../selftests/bpf/prog_tests/socket_cookie.c
attachment strategy and different headers.
Signed-off-by: Florent Revest
---
.../selftests/bpf/prog_tests/socket_cookie.c | 24 +++
.../selftests/bpf/progs/socket_cookie_prog.c | 41 ---
2 files changed, 52 insertions(+), 13 deletions(-)
diff --git a/tools/testing
rted-by: Daniel Borkmann
Signed-off-by: Florent Revest
---
include/uapi/linux/bpf.h | 8
tools/include/uapi/linux/bpf.h | 8
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index c001766adcbc..0b735c2729b2 10064
This needs a new helper that:
- can work in a sleepable context (using sock_gen_cookie)
- takes a struct sock pointer and checks that it's not NULL
Signed-off-by: Florent Revest
---
include/linux/bpf.h| 1 +
include/uapi/linux/bpf.h | 8
kernel/trace/bpf_tr
On Fri, Dec 18, 2020 at 4:20 AM Alexei Starovoitov
wrote:
> As far as 6 arg issue:
> long bpf_snprintf(const char *out, u32 out_size,
> const char *fmt, u32 fmt_size,
> const void *data, u32 data_len);
> Yeah. It won't work as-is, but fmt_size is unnecessary now
wrote:
> > > >
> > > > On Thu, Dec 17, 2020 at 09:26:09AM -0800, Yonghong Song wrote:
> > > > >
> > > > >
> > > > > On 12/17/20 7:31 AM, Florent Revest wrote:
> > > > > > On Mon, Dec 14, 2020 at 7:47 AM Yonghon
On Tue, Dec 22, 2020 at 3:18 PM Christoph Hellwig wrote:
>
> FYI, there is a reason why kallsyms_lookup is not exported any more.
> I don't think adding that back through a backdoor is a good idea.
Did you maybe mean kallsyms_lookup_name (the one that looks an address
up based on a symbol name) ?
On Mon, Dec 14, 2020 at 7:47 AM Yonghong Song wrote:
> On 12/11/20 6:40 AM, Florent Revest wrote:
> > On Wed, Dec 2, 2020 at 10:18 PM Alexei Starovoitov
> > wrote:
> >> I still think that adopting printk/vsnprintf for this instead of
> >> reinventing the wheel
&g
On Wed, Dec 2, 2020 at 10:18 PM Alexei Starovoitov
wrote:
> I still think that adopting printk/vsnprintf for this instead of
> reinventing the wheel
> is more flexible and easier to maintain long term.
> Almost the same layout can be done with vsnprintf
> with exception of \0 char.
> More meaningf
attachment strategy and different headers.
Signed-off-by: Florent Revest
---
.../selftests/bpf/prog_tests/socket_cookie.c | 24 +++
.../selftests/bpf/progs/socket_cookie_prog.c | 41 ---
2 files changed, 52 insertions(+), 13 deletions(-)
diff --git a/tools/testing
rted-by: Daniel Borkmann
Signed-off-by: Florent Revest
---
include/uapi/linux/bpf.h | 8
tools/include/uapi/linux/bpf.h | 8
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 30b477a26482..ba59309f4d18 10064
types such as LSM.
Signed-off-by: Florent Revest
---
include/linux/bpf.h| 1 +
include/uapi/linux/bpf.h | 7 +++
kernel/trace/bpf_trace.c | 2 ++
net/core/filter.c | 12
tools/include/uapi/linux/bpf.h | 7 +++
5 files changed, 29
etons
- rewriting the server/client code with network helpers
- rewriting the cgroup code with test__join_cgroup
- rewriting the error handling code with CHECKs
Signed-off-by: Florent Revest
---
tools/testing/selftests/bpf/Makefile | 3 +-
.../selftests/bpf/prog_tests/socket_cookie.c
On Tue, 2020-12-08 at 23:08 +0100, KP Singh wrote:
> My understanding is you can simply always call sock_gen_cookie and
> not have two protos.
>
> This will disable preemption in sleepable programs and not have any
> effect in non-sleepable programs since preemption will already be
> disabled.
Su
1 - 100 of 186 matches
Mail list logo