v2 of the capacity-rollback fix was correct for bpf_stream_push_str(), but review asked to:
1. refactor bpf_stream_release_capacity() to take a length; 2. fix the staging-path capacity leak and use vscnprintf(); 3. return partial bpf_stream_read() progress on copy_to_user() fault; 4. reject truncated bpf_stream_vprintk() output with -E2BIG before charging capacity; 5. add selftests for the oversize and straddling-buffer cases. This series addresses those points. Tested locally: stream_oversize and stream_partial_read (equivalent to ./test_progs -t stream_oversize,stream_partial_read). v2: https://lore.kernel.org/bpf/[email protected]/ v1: https://lore.kernel.org/bpf/[email protected]/ Jianlin Shi (5): bpf: roll back stream capacity when allocation fails bpf: fix stream capacity leak in staging path bpf: return partial progress from bpf_stream_read on fault bpf: reject oversized bpf_stream_vprintk output with -E2BIG selftests/bpf: cover stream capacity and partial read edge cases kernel/bpf/stream.c | 54 ++++++++------ .../testing/selftests/bpf/prog_tests/stream.c | 70 +++++++++++++++++++ tools/testing/selftests/bpf/progs/stream.c | 12 ++++ 3 files changed, 116 insertions(+), 20 deletions(-) -- 2.43.0

