aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-02-15 16:36:43 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2019-02-15 16:36:43 -0500
commit5ded5871030eb75017639148da0a58931dfbfc25 (patch)
tree70af5c9230924fa516e459ebbf53aa30d2aa1a7d
parent24f0a48743a256bdec1bcb80708bc309da4aa261 (diff)
parent388a49959ee4e4e99f160241d9599efa62cd4299 (diff)
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Two fairly small fixes: the qla one is a panic inducing use after free and the entropy fix may seem minor but it has had huge userspace impact thanks to an unrelated change in openssl that causes sshd to refuse logins until it has enough entropy for the session keys, which causes tens of minutes delay before the affected systems allow logins after reboot" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: qla2xxx: Fix panic from use after free in qla2x00_async_tm_cmd scsi: sd: fix entropy gathering for most rotational disks
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c4
-rw-r--r--drivers/scsi/sd.c12
2 files changed, 11 insertions, 5 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index aeeb0144bd55..8d1acc802a67 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1785,13 +1785,13 @@ qla2x00_async_tm_cmd(fc_port_t *fcport, uint32_t flags, uint32_t lun,
1785 1785
1786 /* Issue Marker IOCB */ 1786 /* Issue Marker IOCB */
1787 qla2x00_marker(vha, vha->hw->req_q_map[0], 1787 qla2x00_marker(vha, vha->hw->req_q_map[0],
1788 vha->hw->rsp_q_map[0], sp->fcport->loop_id, lun, 1788 vha->hw->rsp_q_map[0], fcport->loop_id, lun,
1789 flags == TCF_LUN_RESET ? MK_SYNC_ID_LUN : MK_SYNC_ID); 1789 flags == TCF_LUN_RESET ? MK_SYNC_ID_LUN : MK_SYNC_ID);
1790 } 1790 }
1791 1791
1792done_free_sp: 1792done_free_sp:
1793 sp->free(sp); 1793 sp->free(sp);
1794 sp->fcport->flags &= ~FCF_ASYNC_SENT; 1794 fcport->flags &= ~FCF_ASYNC_SENT;
1795done: 1795done:
1796 return rval; 1796 return rval;
1797} 1797}
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index b2da8a00ec33..5464d467e23e 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2951,9 +2951,6 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp)
2951 if (rot == 1) { 2951 if (rot == 1) {
2952 blk_queue_flag_set(QUEUE_FLAG_NONROT, q); 2952 blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
2953 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q); 2953 blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q);
2954 } else {
2955 blk_queue_flag_clear(QUEUE_FLAG_NONROT, q);
2956 blk_queue_flag_set(QUEUE_FLAG_ADD_RANDOM, q);
2957 } 2954 }
2958 2955
2959 if (sdkp->device->type == TYPE_ZBC) { 2956 if (sdkp->device->type == TYPE_ZBC) {
@@ -3090,6 +3087,15 @@ static int sd_revalidate_disk(struct gendisk *disk)
3090 if (sdkp->media_present) { 3087 if (sdkp->media_present) {
3091 sd_read_capacity(sdkp, buffer); 3088 sd_read_capacity(sdkp, buffer);
3092 3089
3090 /*
3091 * set the default to rotational. All non-rotational devices
3092 * support the block characteristics VPD page, which will
3093 * cause this to be updated correctly and any device which
3094 * doesn't support it should be treated as rotational.
3095 */
3096 blk_queue_flag_clear(QUEUE_FLAG_NONROT, q);
3097 blk_queue_flag_set(QUEUE_FLAG_ADD_RANDOM, q);
3098
3093 if (scsi_device_supports_vpd(sdp)) { 3099 if (scsi_device_supports_vpd(sdp)) {
3094 sd_read_block_provisioning(sdkp); 3100 sd_read_block_provisioning(sdkp);
3095 sd_read_block_limits(sdkp); 3101 sd_read_block_limits(sdkp);