mbox series

[bpf,v3,0/3] Fix local storage helper OOPs

Message ID 20210112075525.256820-1-kpsingh@kernel.org (mailing list archive)
Headers show
Series Fix local storage helper OOPs | expand

Message

KP Singh Jan. 12, 2021, 7:55 a.m. UTC
# 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(-)

Comments

patchwork-bot+netdevbpf@kernel.org Jan. 12, 2021, 3:20 p.m. UTC | #1
Hello:

This series was applied to bpf/bpf.git (refs/heads/master):

On Tue, 12 Jan 2021 07:55:22 +0000 you wrote:
> # 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].
> 
> [...]

Here is the summary with links:
  - [bpf,v3,1/3] bpf: update local storage test to check handling of null ptrs
    https://git.kernel.org/bpf/bpf/c/2f94ac191846
  - [bpf,v3,2/3] bpf: local storage helpers should check nullness of owner ptr passed
    https://git.kernel.org/bpf/bpf/c/1a9c72ad4c26
  - [bpf,v3,3/3] bpf: Fix typo in bpf_inode_storage.c
    https://git.kernel.org/bpf/bpf/c/84d571d46c70

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html