• Bart Van Assche's avatar
    IB/srpt: Simplify srpt_handle_tsk_mgmt() · c8db91d6
    Bart Van Assche authored
    commit 51093254 upstream.
    
    Let the target core check task existence instead of the SRP target
    driver. Additionally, let the target core check the validity of the
    task management request instead of the ib_srpt driver.
    
    This patch fixes the following kernel crash:
    
    BUG: unable to handle kernel NULL pointer dereference at 0000000000000001
    IP: [<ffffffffa0565f37>] srpt_handle_new_iu+0x6d7/0x790 [ib_srpt]
    Oops: 0002 [#1] SMP
    Call Trace:
     [<ffffffffa05660ce>] srpt_process_completion+0xde/0x570 [ib_srpt]
     [<ffffffffa056669f>] srpt_compl_thread+0x13f/0x160 [ib_srpt]
     [<ffffffff8109726f>] kthread+0xcf/0xe0
     [<ffffffff81613cfc>] ret_from_fork+0x7c/0xb0
    Signed-off-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
    Fixes: 3e4f5748 ("ib_srpt: Convert TMR path to target_submit_tmr")
    Tested-by: default avatarAlex Estrin <alex.estrin@intel.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Cc: Nicholas Bellinger <nab@linux-iscsi.org>
    Cc: Sagi Grimberg <sagig@mellanox.com>
    Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
    [bwh: Backported to 3.16: deleted code is slightly different]
    Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
    c8db91d6
ib_srpt.c 103 KB