Fix local storage helper OOPs
Status from this message: This series was applied to bpf/bpf.git (refs/heads/master):
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest3 patches 4 repliesApplied 3/3
- v23 patches 4 repliesSuperseded
Patches in v3 All 3 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | bpf: update local storage test to check handling of null ptrstools/ tools/ | +61 | 4 replies | Applied |
| 2/3 | bpf: local storage helpers should check nullness of owner ptr passedkernel/ kernel/ | +8 | 0 replies | Applied |
| 3/3 | bpf: Fix typo in bpf_inode_storage.ckernel/ | +2 | 0 replies | Applied |
Reviews trailers per patch
All 3 patches have a Reviewed-by or Acked-by.
| Patch | Yonghong Song | Martin KaFai Lau |
|---|---|---|
| 1/3 | A-b | |
| 2/3 | A-b | A-b |
| 3/3 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH bpf v3 0/3] Fix local storage helper OOPs
# v2 -> v3
* Checking the return value of mkdtemp intead of errno
* Added Yonghong's Acks
It was noted in
https://lore.kernel.org/bpf/CACYkzJ55X8Tp2q4+EFf2hOM_Lysoim1xJY1YdA3k=T3woMW6mg@mail.gmail.com/T/#t
that the local storage helpers do not handle null owner pointers correctly. This patch fixes the task and inode storage helpers with a null check. In order to keep the check explicit, it's kept in the body of the helpers similar to sk_storage and also fixes a minor typo in bpf_inode_storage.c [I did not add a fixes and reported tag to the patch that fixes the typo since it's a non-functional change].
The series also incorporates the example posted by Gilad into the selftest. The selftest, without the fix reproduces the oops and the subsequent patch fixes it.
KP Singh (3):
bpf: update local storage test to check handling of null ptrs
bpf: local storage helpers should check nullness of owner ptr passed
bpf: Fix typo in bpf_inode_storage.c
kernel/bpf/bpf_inode_storage.c | 9 +- kernel/bpf/bpf_task_storage.c | 5 +- .../bpf/prog_tests/test_local_storage.c | 96 +++++-------------- .../selftests/bpf/progs/local_storage.c | 62 ++++++------ 4 files changed, 71 insertions(+), 101 deletions(-)
Signature · 1 line
2.30.0.284.gd98b1dd5eaa7-goog