linux_dsm_epyc7002/drivers/s390
Harald Freudenberger 026499a9c2 s390/zcrypt: fix zcard and zqueue hot-unplug memleak
commit 70fac8088cfad9f3b379c9082832b4d7532c16c2 upstream.

Tests with kvm and a kmemdebug kernel showed, that on hot unplug the
zcard and zqueue structs for the unplugged card or queue are not
properly freed because of a mismatch with get/put for the embedded
kref counter.

This fix now adjusts the handling of the kref counters. With init the
kref counter starts with 1. This initial value needs to drop to zero
with the unregister of the card or queue to trigger the release and
free the object.

Fixes: 29c2680fd2 ("s390/ap: fix ap devices reference counting")
Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Cc: stable@vger.kernel.org
Reviewed-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-11 14:47:11 +02:00
..
block s390/dasd: fix hanging IO request during DASD driver unbind 2021-03-17 17:06:28 +01:00
char s390 updates for the 5.10 merge window 2020-10-16 12:36:38 -07:00
cio s390/cio: return -EFAULT if copy_to_user() fails 2021-03-17 17:06:19 +01:00
crypto s390/zcrypt: fix zcard and zqueue hot-unplug memleak 2021-05-11 14:47:11 +02:00
net s390/qeth: schedule TX NAPI on QAOB completion 2021-03-25 09:04:13 +01:00
scsi s390 updates for the 5.10 merge window 2020-10-16 12:36:38 -07:00
virtio virtio/s390: implement virtio-ccw revision 2 correctly 2021-03-04 11:38:42 +01:00
Makefile