• Julian Wiedmann's avatar
    s390/qeth: serialize cmd reply with concurrent timeout · 072f7940
    Julian Wiedmann authored
    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: default avatarJulian Wiedmann <jwi@linux.ibm.com>
    Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
    072f7940
qeth_core_main.c 163 KB