diff options
| author | Jianlin Shi <shijianlin11@foxmail.com> | 2026-08-23 22:17:25 +0800 |
|---|---|---|
| committer | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2026-08-23 20:45:20 +0200 |
| commit | effa6370ba89e7839c9bfeb802d8f05d6843ddf1 (patch) | |
| tree | 77cd7036a97f15263eb8618b1dce8d95e2773ddc /scripts | |
| parent | bd2466ed8fc2ee54408bfe433e75f9f46bfa04f7 (diff) | |
| download | linux-next-effa6370ba89e7839c9bfeb802d8f05d6843ddf1.tar.gz linux-next-effa6370ba89e7839c9bfeb802d8f05d6843ddf1.zip | |
bpf: Fix stream capacity leak in staging path
bpf_stream_stage_printk() increments ss->len before pushing the
formatted string to the staging log. If element allocation fails,
ss->len remains inflated and bpf_stream_stage_commit() permanently
charges the stream capacity for data that was never queued.
Only account the string length after a successful push, and use
vscnprintf() so the staged length is the truncated payload without
the trailing NUL.
Fixes: 5ab154f1463a ("bpf: Introduce BPF standard streams")
Signed-off-by: Jianlin Shi <shijianlin11@foxmail.com>
Link: https://lore.kernel.org/r/46898fb1ae482b2f8b1da459922b187378dfdc1d.1787492521.git.shijianlin11@foxmail.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
