• Bart Van Assche's avatar
    scsi: target/iscsi: Make iscsit_map_iovec() more robust · 2e39f1c9
    Bart Van Assche authored
    Make the code for mapping an iovec more robust by checking the bounds of
    the allocated iovec. This patch avoids that the following crash occurs if a
    map attempt is made that exceeds the bounds of the iovec that is being
    mapped:
    
    BUG: unable to handle kernel NULL pointer dereference at 00000000
    00000014
    RIP: 0010:iscsit_map_iovec+0x120/0x190 [iscsi_target_mod]
    Call Trace:
     iscsit_get_rx_pdu+0x8a2/0xe00 [iscsi_target_mod]
     iscsi_target_rx_thread+0x6e/0xa0 [iscsi_target_mod]
     kthread+0x109/0x140
    
    Cc: Mike Christie <mchristi@redhat.com>
    Cc: Hannes Reinecke <hare@suse.de>
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    2e39f1c9
iscsi_target.c 127 KB