BPF List
 help / color / mirror / Atom feed
* [PATCH bpf-next v4] bpf: Warn on non-preallocated case for BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE
@ 2022-07-13 16:09 Yafang Shao
  2022-07-13 19:52 ` Yonghong Song
  2022-07-14 21:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Yafang Shao @ 2022-07-13 16:09 UTC (permalink / raw)
  To: ast, daniel, andrii, kafai, songliubraving, yhs, john.fastabend,
	kpsingh
  Cc: netdev, bpf, Yafang Shao

BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE is also tracing type, which may
cause unexpected memory allocation if we set BPF_F_NO_PREALLOC.
Let's also warn on it.

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>

---
v4: warn on BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE only (Yonghong)
---
 kernel/bpf/verifier.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 328cfab3af60..c5b11d772663 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -12562,6 +12562,7 @@ static bool is_tracing_prog_type(enum bpf_prog_type type)
 	case BPF_PROG_TYPE_TRACEPOINT:
 	case BPF_PROG_TYPE_PERF_EVENT:
 	case BPF_PROG_TYPE_RAW_TRACEPOINT:
+	case BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE:
 		return true;
 	default:
 		return false;
-- 
2.17.1


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

* Re: [PATCH bpf-next v4] bpf: Warn on non-preallocated case for BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE
  2022-07-13 16:09 [PATCH bpf-next v4] bpf: Warn on non-preallocated case for BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE Yafang Shao
@ 2022-07-13 19:52 ` Yonghong Song
  2022-07-14 21:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Yonghong Song @ 2022-07-13 19:52 UTC (permalink / raw)
  To: Yafang Shao, ast, daniel, andrii, kafai, songliubraving,
	john.fastabend, kpsingh
  Cc: netdev, bpf



On 7/13/22 9:09 AM, Yafang Shao wrote:
> BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE is also tracing type, which may
> cause unexpected memory allocation if we set BPF_F_NO_PREALLOC.
> Let's also warn on it.
> 
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>

Acked-by: Yonghong Song <yhs@fb.com>

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

* Re: [PATCH bpf-next v4] bpf: Warn on non-preallocated case for BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE
  2022-07-13 16:09 [PATCH bpf-next v4] bpf: Warn on non-preallocated case for BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE Yafang Shao
  2022-07-13 19:52 ` Yonghong Song
@ 2022-07-14 21:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-07-14 21:00 UTC (permalink / raw)
  To: Yafang Shao
  Cc: ast, daniel, andrii, kafai, songliubraving, yhs, john.fastabend,
	kpsingh, netdev, bpf

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:

On Wed, 13 Jul 2022 16:09:36 +0000 you wrote:
> BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE is also tracing type, which may
> cause unexpected memory allocation if we set BPF_F_NO_PREALLOC.
> Let's also warn on it.
> 
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> 
> 
> [...]

Here is the summary with links:
  - [bpf-next,v4] bpf: Warn on non-preallocated case for BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE
    https://git.kernel.org/bpf/bpf-next/c/5002615a37b1

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] 3+ messages in thread

end of thread, other threads:[~2022-07-14 21:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-13 16:09 [PATCH bpf-next v4] bpf: Warn on non-preallocated case for BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE Yafang Shao
2022-07-13 19:52 ` Yonghong Song
2022-07-14 21:00 ` 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