summaryrefslogtreecommitdiff
path: root/mm/filemap.c
diff options
context:
space:
mode:
authorStefano Garzarella <sgarzare@redhat.com>2025-01-10 09:35:11 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-23 17:21:16 +0100
commitbc9c49341f9728c31fe248c5fbba32d2e81a092b (patch)
treee30838945fe1563c66c749a30c93023165ebd429 /mm/filemap.c
parent8a15c81063b9c6b145d98ef52dc6c42bc44308e0 (diff)
downloadlinux-bc9c49341f9728c31fe248c5fbba32d2e81a092b.tar.gz
linux-bc9c49341f9728c31fe248c5fbba32d2e81a092b.tar.bz2
linux-bc9c49341f9728c31fe248c5fbba32d2e81a092b.zip
vsock: prevent null-ptr-deref in vsock_*[has_data|has_space]
commit 91751e248256efc111e52e15115840c35d85abaf upstream. Recent reports have shown how we sometimes call vsock_*_has_data() when a vsock socket has been de-assigned from a transport (see attached links), but we shouldn't. Previous commits should have solved the real problems, but we may have more in the future, so to avoid null-ptr-deref, we can return 0 (no space, no data available) but with a warning. This way the code should continue to run in a nearly consistent state and have a warning that allows us to debug future problems. Fixes: c0cfa2d8a788 ("vsock: add multi-transports support") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/netdev/Z2K%2FI4nlHdfMRTZC@v4bel-B760M-AORUS-ELITE-AX/ Link: https://lore.kernel.org/netdev/5ca20d4c-1017-49c2-9516-f6f75fd331e9@rbox.co/ Link: https://lore.kernel.org/netdev/677f84a8.050a0220.25a300.01b3.GAE@google.com/ Co-developed-by: Hyunwoo Kim <v4bel@theori.io> Signed-off-by: Hyunwoo Kim <v4bel@theori.io> Co-developed-by: Wongi Lee <qwerty@theori.io> Signed-off-by: Wongi Lee <qwerty@theori.io> Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Luigi Leonardi <leonardi@redhat.com> Reviewed-by: Hyunwoo Kim <v4bel@theori.io> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/filemap.c')
0 files changed, 0 insertions, 0 deletions