linux-stable/drivers/xen
Dan Carpenter d33d0667c7 xen/pvcalls-back: fix double frees with pvcalls_new_active_socket()
commit 8fafac202d upstream.

In the pvcalls_new_active_socket() function, most error paths call
pvcalls_back_release_active(fedata->dev, fedata, map) which calls
sock_release() on "sock".  The bug is that the caller also frees sock.

Fix this by making every error path in pvcalls_new_active_socket()
release the sock, and don't free it in the caller.

Fixes: 5db4d286a8 ("xen/pvcalls: implement connect command")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/e5f98dc2-0305-491f-a860-71bbd1398a2f@kili.mountain
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-05-30 12:42:15 +01:00
..
events xen/events: only register debug interrupt for 2-level events 2023-01-18 11:30:07 +01:00
xen-pciback
xenbus xen/xenbus: fix return type in xenbus_file_read() 2022-08-25 11:15:39 +02:00
xenfs
acpi.c
arm-device.c
balloon.c
biomerge.c
cpu_hotplug.c
dbgp.c
efi.c
evtchn.c
fallback.c
features.c
gntalloc.c
gntdev-common.h xen/gntdev: Avoid blocking in unmap_grant_pages() 2022-07-07 17:35:11 +02:00
gntdev-dmabuf.c
gntdev-dmabuf.h
gntdev.c xen/gntdev: Prevent leaking grants 2022-11-03 23:52:29 +09:00
grant-table.c
Kconfig
Makefile
manage.c
mcelog.c
mem-reservation.c
pci.c
pcpu.c xen/pcpu: fix possible memory leak in register_pcpu() 2022-11-25 17:40:24 +01:00
platform-pci.c xen/platform-pci: add missing free_irq() in error path 2022-12-08 11:18:31 +01:00
preempt.c
privcmd-buf.c
privcmd.c xen/privcmd: Fix a possible warning in privcmd_ioctl_mmap_resource() 2023-01-18 11:30:07 +01:00
privcmd.h
pvcalls-back.c xen/pvcalls-back: fix double frees with pvcalls_new_active_socket() 2023-05-30 12:42:15 +01:00
pvcalls-front.c
pvcalls-front.h
swiotlb-xen.c
sys-hypervisor.c
time.c
tmem.c
xen-acpi-cpuhotplug.c
xen-acpi-memhotplug.c
xen-acpi-pad.c
xen-acpi-processor.c
xen-balloon.c
xen-scsiback.c
xen-selfballoon.c
xen-stub.c
xlate_mmu.c