summaryrefslogtreecommitdiffstats
path: root/mm/usercopy.c
diff options
context:
space:
mode:
authorJohn Fastabend2018-07-05 17:05:56 +0200
committerAlexei Starovoitov2018-07-08 00:16:58 +0200
commit547b3aa451ae2739585547db9fbdee11a43ff999 (patch)
treee691f1e7a7ce545c4796040583e2a813fb70fa46 /mm/usercopy.c
parentsamples/bpf: add .gitignore file (diff)
downloadkernel-qcow2-linux-547b3aa451ae2739585547db9fbdee11a43ff999.tar.gz
kernel-qcow2-linux-547b3aa451ae2739585547db9fbdee11a43ff999.tar.xz
kernel-qcow2-linux-547b3aa451ae2739585547db9fbdee11a43ff999.zip
bpf: sockmap, error path can not release psock in multi-map case
The current code, in the error path of sock_hash_ctx_update_elem, checks if the sock has a psock in the user data and if so decrements the reference count of the psock. However, if the error happens early in the error path we may have never incremented the psock reference count and if the psock exists because the sock is in another map then we may inadvertently decrement the reference count. Fix this by making the error path only call smap_release_sock if the error happens after the increment. Reported-by: syzbot+d464d2c20c717ef5a6a8@syzkaller.appspotmail.com Fixes: 81110384441a ("bpf: sockmap, add hash map support") Signed-off-by: John Fastabend <john.fastabend@gmail.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'mm/usercopy.c')
0 files changed, 0 insertions, 0 deletions