mbox series

[net,v2,0/2] vsock: null-ptr-deref when SO_LINGER enabled

Message ID 20250206-vsock-linger-nullderef-v2-0-f8a1f19146f8@rbox.co (mailing list archive)
Headers show
Series vsock: null-ptr-deref when SO_LINGER enabled | expand

Message

Michal Luczaj Feb. 5, 2025, 11:06 p.m. UTC
syzbot pointed out that a recent patching of a use-after-free introduced a
null-ptr-deref. This series fixes the problem and adds a test.

Stefano, regarding the test: I wasn't sure about the lingering behaviour,
so I've left that part for later.

Fixes fcdd2242c023 ("vsock: Keep the binding until socket destruction").

Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
Changes in v2:
- Collect tags [Luigi]
- Explain the reason for the explicit set_flag(SOCK_DEAD) [Stefano]
- Link to v1: https://lore.kernel.org/r/20250204-vsock-linger-nullderef-v1-0-6eb1760fa93e@rbox.co

---
Michal Luczaj (2):
      vsock: Orphan socket after transport release
      vsock/test: Add test for SO_LINGER null ptr deref

 net/vmw_vsock/af_vsock.c         | 15 ++++++++++-----
 tools/testing/vsock/vsock_test.c | 41 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 5 deletions(-)
---
base-commit: a1300691aed9ee852b0a9192e29e2bdc2411a7e6
change-id: 20250203-vsock-linger-nullderef-cbe4402ad306

Best regards,