linux-stable/drivers/s390
Julian Wiedmann 14d066c353 s390/qeth: fix double-free on IP add/remove race
Registering an IPv4 address with the HW takes quite a while, so we
temporarily drop the ip_htable lock. Any concurrent add/remove of the
same IP adjusts the IP's use count, and (on remove) is then blocked by
addr->in_progress.
After the register call has completed, we check the use count for
concurrently attempted add/remove calls - and possibly straight-away
deregister the IP again. This happens via l3_delete_ip(), which
1) looks up the queried IP in the htable (getting a reference to the
   *same* queried object),
2) deregisters the IP from the HW, and
3) frees the IP object.

The caller in l3_add_ip() then does a second free on the same object.

For this case, skip all the extra checks and lookups in l3_delete_ip()
and just deregister & free the IP object ourselves.

Fixes: 5f78e29cee ("qeth: optimize IP handling in rx_mode callback")
Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-02-28 11:13:12 -05:00
..
block vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
char vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
cio s390/cio: fix kernel-doc usage 2018-02-05 07:34:52 +01:00
crypto treewide: Use DEVICE_ATTR_RO 2018-01-09 16:34:34 +01:00
net s390/qeth: fix double-free on IP add/remove race 2018-02-28 11:13:12 -05:00
scsi s390: add a few more SPDX identifiers 2017-12-05 07:51:09 +01:00
virtio virtio/s390: implement PM operations for virtio_ccw 2018-02-14 14:34:09 +02:00
Makefile s390: add a few more SPDX identifiers 2017-12-05 07:51:09 +01:00