netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/3] bpf: Allow helpers access ptr_to_btf_id.
@ 2023-03-13 23:58 Alexei Starovoitov
  2023-03-13 23:58 ` [PATCH bpf-next 1/3] bpf: Fix bpf_strncmp proto Alexei Starovoitov
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Alexei Starovoitov @ 2023-03-13 23:58 UTC (permalink / raw)
  To: davem
  Cc: daniel, andrii, martin.lau, void, davemarchevsky, tj, memxor,
	netdev, bpf, kernel-team

From: Alexei Starovoitov <ast@kernel.org>

Allow code like:
bpf_strncmp(task->comm, 16, "foo");

Alexei Starovoitov (3):
  bpf: Fix bpf_strncmp proto.
  bpf: Allow helpers access trusted PTR_TO_BTF_ID.
  selftests/bpf: Add various tests to check helper access into
    ptr_to_btf_id.

 kernel/bpf/helpers.c                          |  2 +-
 kernel/bpf/verifier.c                         | 15 ++++++++
 .../selftests/bpf/progs/task_kfunc_failure.c  | 36 +++++++++++++++++++
 .../selftests/bpf/progs/task_kfunc_success.c  |  4 +++
 4 files changed, 56 insertions(+), 1 deletion(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH bpf-next 1/3] bpf: Fix bpf_strncmp proto.
  2023-03-13 23:58 [PATCH bpf-next 0/3] bpf: Allow helpers access ptr_to_btf_id Alexei Starovoitov
@ 2023-03-13 23:58 ` Alexei Starovoitov
  2023-03-14  0:02   ` David Vernet
  2023-03-13 23:58 ` [PATCH bpf-next 2/3] bpf: Allow helpers access trusted PTR_TO_BTF_ID Alexei Starovoitov
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Alexei Starovoitov @ 2023-03-13 23:58 UTC (permalink / raw)
  To: davem
  Cc: daniel, andrii, martin.lau, void, davemarchevsky, tj, memxor,
	netdev, bpf, kernel-team

From: Alexei Starovoitov <ast@kernel.org>

bpf_strncmp() doesn't write into its first argument.
Make sure that the verifier knows about it.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
---
 kernel/bpf/helpers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
index 77d64b6951b9..f753676ef652 100644
--- a/kernel/bpf/helpers.c
+++ b/kernel/bpf/helpers.c
@@ -571,7 +571,7 @@ static const struct bpf_func_proto bpf_strncmp_proto = {
 	.func		= bpf_strncmp,
 	.gpl_only	= false,
 	.ret_type	= RET_INTEGER,
-	.arg1_type	= ARG_PTR_TO_MEM,
+	.arg1_type	= ARG_PTR_TO_MEM | MEM_RDONLY,
 	.arg2_type	= ARG_CONST_SIZE,
 	.arg3_type	= ARG_PTR_TO_CONST_STR,
 };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH bpf-next 2/3] bpf: Allow helpers access trusted PTR_TO_BTF_ID.
  2023-03-13 23:58 [PATCH bpf-next 0/3] bpf: Allow helpers access ptr_to_btf_id Alexei Starovoitov
  2023-03-13 23:58 ` [PATCH bpf-next 1/3] bpf: Fix bpf_strncmp proto Alexei Starovoitov
@ 2023-03-13 23:58 ` Alexei Starovoitov
  2023-03-14  0:07   ` David Vernet
  2023-03-13 23:58 ` [PATCH bpf-next 3/3] selftests/bpf: Add various tests to check helper access into ptr_to_btf_id Alexei Starovoitov
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Alexei Starovoitov @ 2023-03-13 23:58 UTC (permalink / raw)
  To: davem
  Cc: daniel, andrii, martin.lau, void, davemarchevsky, tj, memxor,
	netdev, bpf, kernel-team

From: Alexei Starovoitov <ast@kernel.org>

The verifier rejects the code:
  bpf_strncmp(task->comm, 16, "my_task");
with the message:
  16: (85) call bpf_strncmp#182
  R1 type=trusted_ptr_ expected=fp, pkt, pkt_meta, map_key, map_value, mem, ringbuf_mem, buf

Teach the verifier that such access pattern is safe.
Do not allow untrusted and legacy ptr_to_btf_id to be passed into helpers.

Reported-by: David Vernet <void@manifault.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
---
 kernel/bpf/verifier.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 883d4ff2e288..2bbd89279070 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -6303,6 +6303,9 @@ static int check_helper_mem_access(struct bpf_verifier_env *env, int regno,
 				env,
 				regno, reg->off, access_size,
 				zero_size_allowed, ACCESS_HELPER, meta);
+	case PTR_TO_BTF_ID:
+		return check_ptr_to_btf_access(env, regs, regno, reg->off,
+					       access_size, BPF_READ, -1);
 	case PTR_TO_CTX:
 		/* in case the function doesn't know how to access the context,
 		 * (because we are in a program of type SYSCALL for example), we
@@ -7014,6 +7017,7 @@ static const struct bpf_reg_types mem_types = {
 		PTR_TO_MEM,
 		PTR_TO_MEM | MEM_RINGBUF,
 		PTR_TO_BUF,
+		PTR_TO_BTF_ID | PTR_TRUSTED,
 	},
 };
 
@@ -7145,6 +7149,17 @@ static int check_reg_type(struct bpf_verifier_env *env, u32 regno,
 	if (base_type(reg->type) != PTR_TO_BTF_ID)
 		return 0;
 
+	if (compatible == &mem_types) {
+		if (!(arg_type & MEM_RDONLY)) {
+			verbose(env,
+				"%s() may write into memory pointed by R%d type=%s\n",
+				func_id_name(meta->func_id),
+				regno, reg_type_str(env, reg->type));
+			return -EACCES;
+		}
+		return 0;
+	}
+
 	switch ((int)reg->type) {
 	case PTR_TO_BTF_ID:
 	case PTR_TO_BTF_ID | PTR_TRUSTED:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH bpf-next 3/3] selftests/bpf: Add various tests to check helper access into ptr_to_btf_id.
  2023-03-13 23:58 [PATCH bpf-next 0/3] bpf: Allow helpers access ptr_to_btf_id Alexei Starovoitov
  2023-03-13 23:58 ` [PATCH bpf-next 1/3] bpf: Fix bpf_strncmp proto Alexei Starovoitov
  2023-03-13 23:58 ` [PATCH bpf-next 2/3] bpf: Allow helpers access trusted PTR_TO_BTF_ID Alexei Starovoitov
@ 2023-03-13 23:58 ` Alexei Starovoitov
  2023-03-14  0:15   ` David Vernet
  2023-03-14  5:33 ` [PATCH bpf-next 0/3] bpf: Allow helpers access ptr_to_btf_id John Fastabend
  2023-03-14  6:40 ` patchwork-bot+netdevbpf
  4 siblings, 1 reply; 10+ messages in thread
From: Alexei Starovoitov @ 2023-03-13 23:58 UTC (permalink / raw)
  To: davem
  Cc: daniel, andrii, martin.lau, void, davemarchevsky, tj, memxor,
	netdev, bpf, kernel-team

From: Alexei Starovoitov <ast@kernel.org>

Add various tests to check helper access into ptr_to_btf_id.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
---
 .../selftests/bpf/progs/task_kfunc_failure.c  | 36 +++++++++++++++++++
 .../selftests/bpf/progs/task_kfunc_success.c  |  4 +++
 2 files changed, 40 insertions(+)

diff --git a/tools/testing/selftests/bpf/progs/task_kfunc_failure.c b/tools/testing/selftests/bpf/progs/task_kfunc_failure.c
index 002c7f69e47f..27994d6b2914 100644
--- a/tools/testing/selftests/bpf/progs/task_kfunc_failure.c
+++ b/tools/testing/selftests/bpf/progs/task_kfunc_failure.c
@@ -301,3 +301,39 @@ int BPF_PROG(task_kfunc_from_lsm_task_free, struct task_struct *task)
 	bpf_task_release(acquired);
 	return 0;
 }
+
+SEC("tp_btf/task_newtask")
+__failure __msg("access beyond the end of member comm")
+int BPF_PROG(task_access_comm1, struct task_struct *task, u64 clone_flags)
+{
+	bpf_strncmp(task->comm, 17, "foo");
+	return 0;
+}
+
+SEC("tp_btf/task_newtask")
+__failure __msg("access beyond the end of member comm")
+int BPF_PROG(task_access_comm2, struct task_struct *task, u64 clone_flags)
+{
+	bpf_strncmp(task->comm + 1, 16, "foo");
+	return 0;
+}
+
+SEC("tp_btf/task_newtask")
+__failure __msg("write into memory")
+int BPF_PROG(task_access_comm3, struct task_struct *task, u64 clone_flags)
+{
+	bpf_probe_read_kernel(task->comm, 16, task->comm);
+	return 0;
+}
+
+SEC("fentry/__set_task_comm")
+__failure __msg("R1 type=ptr_ expected")
+int BPF_PROG(task_access_comm4, struct task_struct *task, const char *buf, bool exec)
+{
+	/*
+	 * task->comm is a legacy ptr_to_btf_id. The verifier cannot guarantee
+	 * its safety. Hence it cannot be accessed with normal load insns.
+	 */
+	bpf_strncmp(task->comm, 16, "foo");
+	return 0;
+}
diff --git a/tools/testing/selftests/bpf/progs/task_kfunc_success.c b/tools/testing/selftests/bpf/progs/task_kfunc_success.c
index aebc4bb14e7d..4f61596b0242 100644
--- a/tools/testing/selftests/bpf/progs/task_kfunc_success.c
+++ b/tools/testing/selftests/bpf/progs/task_kfunc_success.c
@@ -207,6 +207,10 @@ int BPF_PROG(test_task_from_pid_invalid, struct task_struct *task, u64 clone_fla
 	if (!is_test_kfunc_task())
 		return 0;
 
+	bpf_strncmp(task->comm, 12, "foo");
+	bpf_strncmp(task->comm, 16, "foo");
+	bpf_strncmp(&task->comm[8], 4, "foo");
+
 	if (is_pid_lookup_valid(-1)) {
 		err = 1;
 		return 0;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH bpf-next 1/3] bpf: Fix bpf_strncmp proto.
  2023-03-13 23:58 ` [PATCH bpf-next 1/3] bpf: Fix bpf_strncmp proto Alexei Starovoitov
@ 2023-03-14  0:02   ` David Vernet
  0 siblings, 0 replies; 10+ messages in thread
From: David Vernet @ 2023-03-14  0:02 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: davem, daniel, andrii, martin.lau, davemarchevsky, tj, memxor,
	netdev, bpf, kernel-team

On Mon, Mar 13, 2023 at 04:58:43PM -0700, Alexei Starovoitov wrote:
> From: Alexei Starovoitov <ast@kernel.org>
> 
> bpf_strncmp() doesn't write into its first argument.
> Make sure that the verifier knows about it.
> 
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Acked-by: David Vernet <void@manifault.com>

> ---
>  kernel/bpf/helpers.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
> index 77d64b6951b9..f753676ef652 100644
> --- a/kernel/bpf/helpers.c
> +++ b/kernel/bpf/helpers.c
> @@ -571,7 +571,7 @@ static const struct bpf_func_proto bpf_strncmp_proto = {
>  	.func		= bpf_strncmp,
>  	.gpl_only	= false,
>  	.ret_type	= RET_INTEGER,
> -	.arg1_type	= ARG_PTR_TO_MEM,
> +	.arg1_type	= ARG_PTR_TO_MEM | MEM_RDONLY,
>  	.arg2_type	= ARG_CONST_SIZE,
>  	.arg3_type	= ARG_PTR_TO_CONST_STR,
>  };
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH bpf-next 2/3] bpf: Allow helpers access trusted PTR_TO_BTF_ID.
  2023-03-13 23:58 ` [PATCH bpf-next 2/3] bpf: Allow helpers access trusted PTR_TO_BTF_ID Alexei Starovoitov
@ 2023-03-14  0:07   ` David Vernet
  0 siblings, 0 replies; 10+ messages in thread
From: David Vernet @ 2023-03-14  0:07 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: davem, daniel, andrii, martin.lau, davemarchevsky, tj, memxor,
	netdev, bpf, kernel-team

On Mon, Mar 13, 2023 at 04:58:44PM -0700, Alexei Starovoitov wrote:
> From: Alexei Starovoitov <ast@kernel.org>
> 
> The verifier rejects the code:
>   bpf_strncmp(task->comm, 16, "my_task");
> with the message:
>   16: (85) call bpf_strncmp#182
>   R1 type=trusted_ptr_ expected=fp, pkt, pkt_meta, map_key, map_value, mem, ringbuf_mem, buf
> 
> Teach the verifier that such access pattern is safe.
> Do not allow untrusted and legacy ptr_to_btf_id to be passed into helpers.
> 
> Reported-by: David Vernet <void@manifault.com>
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Acked-by: David Vernet <void@manifault.com>

> ---
>  kernel/bpf/verifier.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index 883d4ff2e288..2bbd89279070 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -6303,6 +6303,9 @@ static int check_helper_mem_access(struct bpf_verifier_env *env, int regno,
>  				env,
>  				regno, reg->off, access_size,
>  				zero_size_allowed, ACCESS_HELPER, meta);
> +	case PTR_TO_BTF_ID:
> +		return check_ptr_to_btf_access(env, regs, regno, reg->off,
> +					       access_size, BPF_READ, -1);
>  	case PTR_TO_CTX:
>  		/* in case the function doesn't know how to access the context,
>  		 * (because we are in a program of type SYSCALL for example), we
> @@ -7014,6 +7017,7 @@ static const struct bpf_reg_types mem_types = {
>  		PTR_TO_MEM,
>  		PTR_TO_MEM | MEM_RINGBUF,
>  		PTR_TO_BUF,
> +		PTR_TO_BTF_ID | PTR_TRUSTED,
>  	},
>  };
>  
> @@ -7145,6 +7149,17 @@ static int check_reg_type(struct bpf_verifier_env *env, u32 regno,
>  	if (base_type(reg->type) != PTR_TO_BTF_ID)
>  		return 0;
>  
> +	if (compatible == &mem_types) {
> +		if (!(arg_type & MEM_RDONLY)) {
> +			verbose(env,
> +				"%s() may write into memory pointed by R%d type=%s\n",
> +				func_id_name(meta->func_id),
> +				regno, reg_type_str(env, reg->type));
> +			return -EACCES;
> +		}
> +		return 0;
> +	}
> +
>  	switch ((int)reg->type) {
>  	case PTR_TO_BTF_ID:
>  	case PTR_TO_BTF_ID | PTR_TRUSTED:
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH bpf-next 3/3] selftests/bpf: Add various tests to check helper access into ptr_to_btf_id.
  2023-03-13 23:58 ` [PATCH bpf-next 3/3] selftests/bpf: Add various tests to check helper access into ptr_to_btf_id Alexei Starovoitov
@ 2023-03-14  0:15   ` David Vernet
  2023-03-14  0:19     ` Alexei Starovoitov
  0 siblings, 1 reply; 10+ messages in thread
From: David Vernet @ 2023-03-14  0:15 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: davem, daniel, andrii, martin.lau, davemarchevsky, tj, memxor,
	netdev, bpf, kernel-team

On Mon, Mar 13, 2023 at 04:58:45PM -0700, Alexei Starovoitov wrote:
> From: Alexei Starovoitov <ast@kernel.org>
> 
> Add various tests to check helper access into ptr_to_btf_id.
> 
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Thanks a lot for the quick turnaround on this.

LGTM, just left one small nit below.

Acked-by: David Vernet <void@manifault.com>

> ---
>  .../selftests/bpf/progs/task_kfunc_failure.c  | 36 +++++++++++++++++++
>  .../selftests/bpf/progs/task_kfunc_success.c  |  4 +++
>  2 files changed, 40 insertions(+)
> 
> diff --git a/tools/testing/selftests/bpf/progs/task_kfunc_failure.c b/tools/testing/selftests/bpf/progs/task_kfunc_failure.c
> index 002c7f69e47f..27994d6b2914 100644
> --- a/tools/testing/selftests/bpf/progs/task_kfunc_failure.c
> +++ b/tools/testing/selftests/bpf/progs/task_kfunc_failure.c
> @@ -301,3 +301,39 @@ int BPF_PROG(task_kfunc_from_lsm_task_free, struct task_struct *task)
>  	bpf_task_release(acquired);
>  	return 0;
>  }
> +
> +SEC("tp_btf/task_newtask")
> +__failure __msg("access beyond the end of member comm")
> +int BPF_PROG(task_access_comm1, struct task_struct *task, u64 clone_flags)
> +{
> +	bpf_strncmp(task->comm, 17, "foo");

Instead of 17, can you do either TASK_COMM_LEN + 1, or
sizeof(task->comm) + 1, to make the test a bit less brittle? Applies to
the other testcases as well.

> +	return 0;
> +}
> +
> +SEC("tp_btf/task_newtask")
> +__failure __msg("access beyond the end of member comm")
> +int BPF_PROG(task_access_comm2, struct task_struct *task, u64 clone_flags)
> +{
> +	bpf_strncmp(task->comm + 1, 16, "foo");
> +	return 0;
> +}
> +
> +SEC("tp_btf/task_newtask")
> +__failure __msg("write into memory")
> +int BPF_PROG(task_access_comm3, struct task_struct *task, u64 clone_flags)
> +{
> +	bpf_probe_read_kernel(task->comm, 16, task->comm);
> +	return 0;
> +}
> +
> +SEC("fentry/__set_task_comm")
> +__failure __msg("R1 type=ptr_ expected")
> +int BPF_PROG(task_access_comm4, struct task_struct *task, const char *buf, bool exec)
> +{
> +	/*
> +	 * task->comm is a legacy ptr_to_btf_id. The verifier cannot guarantee
> +	 * its safety. Hence it cannot be accessed with normal load insns.
> +	 */
> +	bpf_strncmp(task->comm, 16, "foo");
> +	return 0;
> +}
> diff --git a/tools/testing/selftests/bpf/progs/task_kfunc_success.c b/tools/testing/selftests/bpf/progs/task_kfunc_success.c
> index aebc4bb14e7d..4f61596b0242 100644
> --- a/tools/testing/selftests/bpf/progs/task_kfunc_success.c
> +++ b/tools/testing/selftests/bpf/progs/task_kfunc_success.c
> @@ -207,6 +207,10 @@ int BPF_PROG(test_task_from_pid_invalid, struct task_struct *task, u64 clone_fla
>  	if (!is_test_kfunc_task())
>  		return 0;
>  
> +	bpf_strncmp(task->comm, 12, "foo");
> +	bpf_strncmp(task->comm, 16, "foo");
> +	bpf_strncmp(&task->comm[8], 4, "foo");
> +
>  	if (is_pid_lookup_valid(-1)) {
>  		err = 1;
>  		return 0;
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH bpf-next 3/3] selftests/bpf: Add various tests to check helper access into ptr_to_btf_id.
  2023-03-14  0:15   ` David Vernet
@ 2023-03-14  0:19     ` Alexei Starovoitov
  0 siblings, 0 replies; 10+ messages in thread
From: Alexei Starovoitov @ 2023-03-14  0:19 UTC (permalink / raw)
  To: David Vernet
  Cc: David S. Miller, Daniel Borkmann, Andrii Nakryiko,
	Martin KaFai Lau, Dave Marchevsky, Tejun Heo,
	Kumar Kartikeya Dwivedi, Network Development, bpf, Kernel Team

On Mon, Mar 13, 2023 at 5:15 PM David Vernet <void@manifault.com> wrote:
>
> On Mon, Mar 13, 2023 at 04:58:45PM -0700, Alexei Starovoitov wrote:
> > From: Alexei Starovoitov <ast@kernel.org>
> >
> > Add various tests to check helper access into ptr_to_btf_id.
> >
> > Signed-off-by: Alexei Starovoitov <ast@kernel.org>
>
> Thanks a lot for the quick turnaround on this.
>
> LGTM, just left one small nit below.
>
> Acked-by: David Vernet <void@manifault.com>
>
> > ---
> >  .../selftests/bpf/progs/task_kfunc_failure.c  | 36 +++++++++++++++++++
> >  .../selftests/bpf/progs/task_kfunc_success.c  |  4 +++
> >  2 files changed, 40 insertions(+)
> >
> > diff --git a/tools/testing/selftests/bpf/progs/task_kfunc_failure.c b/tools/testing/selftests/bpf/progs/task_kfunc_failure.c
> > index 002c7f69e47f..27994d6b2914 100644
> > --- a/tools/testing/selftests/bpf/progs/task_kfunc_failure.c
> > +++ b/tools/testing/selftests/bpf/progs/task_kfunc_failure.c
> > @@ -301,3 +301,39 @@ int BPF_PROG(task_kfunc_from_lsm_task_free, struct task_struct *task)
> >       bpf_task_release(acquired);
> >       return 0;
> >  }
> > +
> > +SEC("tp_btf/task_newtask")
> > +__failure __msg("access beyond the end of member comm")
> > +int BPF_PROG(task_access_comm1, struct task_struct *task, u64 clone_flags)
> > +{
> > +     bpf_strncmp(task->comm, 17, "foo");
>
> Instead of 17, can you do either TASK_COMM_LEN + 1, or
> sizeof(task->comm) + 1, to make the test a bit less brittle? Applies to
> the other testcases as well.

I'd rather not, since it's not brittle.
There were several attempts in the past to increase TASK_COMM_LEN
and all failed. It will stay 16 for the foreseeable future.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: [PATCH bpf-next 0/3] bpf: Allow helpers access ptr_to_btf_id.
  2023-03-13 23:58 [PATCH bpf-next 0/3] bpf: Allow helpers access ptr_to_btf_id Alexei Starovoitov
                   ` (2 preceding siblings ...)
  2023-03-13 23:58 ` [PATCH bpf-next 3/3] selftests/bpf: Add various tests to check helper access into ptr_to_btf_id Alexei Starovoitov
@ 2023-03-14  5:33 ` John Fastabend
  2023-03-14  6:40 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 10+ messages in thread
From: John Fastabend @ 2023-03-14  5:33 UTC (permalink / raw)
  To: Alexei Starovoitov, davem
  Cc: daniel, andrii, martin.lau, void, davemarchevsky, tj, memxor,
	netdev, bpf, kernel-team

Alexei Starovoitov wrote:
> From: Alexei Starovoitov <ast@kernel.org>
> 
> Allow code like:
> bpf_strncmp(task->comm, 16, "foo");
> 
> Alexei Starovoitov (3):
>   bpf: Fix bpf_strncmp proto.
>   bpf: Allow helpers access trusted PTR_TO_BTF_ID.
>   selftests/bpf: Add various tests to check helper access into
>     ptr_to_btf_id.
> 
>  kernel/bpf/helpers.c                          |  2 +-
>  kernel/bpf/verifier.c                         | 15 ++++++++
>  .../selftests/bpf/progs/task_kfunc_failure.c  | 36 +++++++++++++++++++
>  .../selftests/bpf/progs/task_kfunc_success.c  |  4 +++
>  4 files changed, 56 insertions(+), 1 deletion(-)
> 
> -- 
> 2.34.1
> 

For the series,

Acked-by: John Fastabend <john.fastabend@gmail.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH bpf-next 0/3] bpf: Allow helpers access ptr_to_btf_id.
  2023-03-13 23:58 [PATCH bpf-next 0/3] bpf: Allow helpers access ptr_to_btf_id Alexei Starovoitov
                   ` (3 preceding siblings ...)
  2023-03-14  5:33 ` [PATCH bpf-next 0/3] bpf: Allow helpers access ptr_to_btf_id John Fastabend
@ 2023-03-14  6:40 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 10+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-03-14  6:40 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: davem, daniel, andrii, martin.lau, void, davemarchevsky, tj,
	memxor, netdev, bpf, kernel-team

Hello:

This series was applied to bpf/bpf-next.git (master)
by Martin KaFai Lau <martin.lau@kernel.org>:

On Mon, 13 Mar 2023 16:58:42 -0700 you wrote:
> From: Alexei Starovoitov <ast@kernel.org>
> 
> Allow code like:
> bpf_strncmp(task->comm, 16, "foo");
> 
> Alexei Starovoitov (3):
>   bpf: Fix bpf_strncmp proto.
>   bpf: Allow helpers access trusted PTR_TO_BTF_ID.
>   selftests/bpf: Add various tests to check helper access into
>     ptr_to_btf_id.
> 
> [...]

Here is the summary with links:
  - [bpf-next,1/3] bpf: Fix bpf_strncmp proto.
    https://git.kernel.org/bpf/bpf-next/c/c9267aa8b794
  - [bpf-next,2/3] bpf: Allow helpers access trusted PTR_TO_BTF_ID.
    https://git.kernel.org/bpf/bpf-next/c/3e30be4288b3
  - [bpf-next,3/3] selftests/bpf: Add various tests to check helper access into ptr_to_btf_id.
    https://git.kernel.org/bpf/bpf-next/c/f25fd6088216

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-03-14  6:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-13 23:58 [PATCH bpf-next 0/3] bpf: Allow helpers access ptr_to_btf_id Alexei Starovoitov
2023-03-13 23:58 ` [PATCH bpf-next 1/3] bpf: Fix bpf_strncmp proto Alexei Starovoitov
2023-03-14  0:02   ` David Vernet
2023-03-13 23:58 ` [PATCH bpf-next 2/3] bpf: Allow helpers access trusted PTR_TO_BTF_ID Alexei Starovoitov
2023-03-14  0:07   ` David Vernet
2023-03-13 23:58 ` [PATCH bpf-next 3/3] selftests/bpf: Add various tests to check helper access into ptr_to_btf_id Alexei Starovoitov
2023-03-14  0:15   ` David Vernet
2023-03-14  0:19     ` Alexei Starovoitov
2023-03-14  5:33 ` [PATCH bpf-next 0/3] bpf: Allow helpers access ptr_to_btf_id John Fastabend
2023-03-14  6:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).