]> git.baikalelectronics.ru Git - kernel.git/commit
s390/qeth: serialize cmd reply with concurrent timeout
authorJulian Wiedmann <jwi@linux.ibm.com>
Mon, 12 Aug 2019 14:44:35 +0000 (16:44 +0200)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 14 Aug 2019 02:26:47 +0000 (19:26 -0700)
commite289b76d1c1f016c3a78b469877138b392bdc5f8
tree7e4f8f96847681fe921c7f38067c464c8a2f4498
parent9341e0ad305201777dcc7897b871a37b06ba270b
s390/qeth: serialize cmd reply with concurrent timeout

Callbacks for a cmd reply run outside the protection of card->lock, to
allow for additional cmds to be issued & enqueued in parallel.

When qeth_send_control_data() bails out for a cmd without having
received a reply (eg. due to timeout), its callback may concurrently be
processing a reply that just arrived. In this case, the callback
potentially accesses a stale reply->reply_param area that eg. was
on-stack and has already been released.

To avoid this race, add some locking so that qeth_send_control_data()
can (1) wait for a concurrently running callback, and (2) zap any
pending callback that still wants to run.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
drivers/s390/net/qeth_core.h
drivers/s390/net/qeth_core_main.c