• Bart Van Assche's avatar
    scsi: core: Make scsi_internal_device_unblock_nowait() reject invalid new_state · 09addb1d
    Bart Van Assche authored
    The only 'new_state' values passed by upstream kernel code to
    scsi_internal_device_unblock_nowait() are SDEV_RUNNING and
    SDEV_TRANSPORT_OFFLINE. These are the only values that should be passed to
    this function. Hence check the value of the 'new_state' argument to avoid
    that scsi_internal_device_unblock_nowait() would be used to trigger an
    illegal SCSI device state transition. In this context 'illegal' means not
    allowed by scsi_device_set_state().
    
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Hannes Reinecke <hare@suse.com>
    Cc: Johannes Thumshirn <jthumshirn@suse.de>
    Cc: Ming Lei <ming.lei@redhat.com>
    Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    09addb1d
scsi_lib.c 81.7 KB