summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJianlin Shi <shijianlin11@foxmail.com>2026-08-23 22:17:24 +0800
committerKumar Kartikeya Dwivedi <memxor@gmail.com>2026-08-23 20:45:20 +0200
commitbd2466ed8fc2ee54408bfe433e75f9f46bfa04f7 (patch)
tree05e8a98b34b1767aef42e60e69638116d4711341 /scripts
parentaf22d273aa1f61fb86ec712b3ed785da73c3296e (diff)
downloadlinux-next-bd2466ed8fc2ee54408bfe433e75f9f46bfa04f7.tar.gz
linux-next-bd2466ed8fc2ee54408bfe433e75f9f46bfa04f7.zip
bpf: Roll back stream capacity when allocation fails
bpf_stream_push_str() accounts the string length before allocating a stream element. If the allocation fails, the length remains charged even though no element is queued and therefore cannot be released by a reader. Repeated failures can exhaust the stream capacity permanently until the BPF program is freed. Refactor bpf_stream_release_capacity() to take a length so the consume and release sides are symmetric, and use it to roll back the charge when creating the stream element fails. Fixes: 5ab154f1463a ("bpf: Introduce BPF standard streams") Signed-off-by: Jianlin Shi <shijianlin11@foxmail.com> Link: https://lore.kernel.org/r/c0ad7b18c59be6695fcc9e4e1200b2f4d5cbbea2.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