Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp237942imj; Fri, 15 Feb 2019 22:41:55 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibn2CEC/+4EFIYXvQUcqvNd+QqsxdJxZUs7fOV+4/XL1trO2/cHbGdn1oWz51pXrSi6G9PU X-Received: by 2002:a65:6215:: with SMTP id d21mr8976867pgv.289.1550299315422; Fri, 15 Feb 2019 22:41:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550299315; cv=none; d=google.com; s=arc-20160816; b=XZSTspXdipGm3G58H7sWcV6xOjgZF19qaBZVTZ6cMgYy2Z+6/0GmfYLHom6CdnehIt pPb/OUdBqhRp5cBz3vHUIqXG1t3b0HLxy63Q8ILMBJe8EsXT1tTgpZJk6aRCggfyFLnk 8iJ2IZmSuYedM/L4jrxtvREl6bEz2w1TBLW/uW/ztyTXxyiqHJ9ebkqhMfpUuxJjQRYJ aiNScwpDbf4K2gfZ8279h5FKNWgaDahnmLY2qa6MANnpvowLEO/c4AQkiPGlvftiQ+RU kzZY96mcb4p+A32EshO1M64AigrEudhEZ3JbnqsNXXgz+/Ko2NtZa8ps0rhj4RrBliu3 7W0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :date:cc:to:from:subject:message-id:dkim-signature; bh=Ve4/qqCCPzRmM9ClA/W6Hmd3qbKxwzvnOzy5zE17jcY=; b=cfzRuPLbdEbgV7zWykZ0P8b9mAjmwUDKCaRcLyP5YbF+ALBu2qoJ5lwR4qmDiJrBoX FdIrZ0NoVmOfREDpmiKBjA/W9YqXVMXJWIm3C/oDRjJPhXYD3UYCmH+Gn2ZkLwqncEq+ WpT2FJlb48+2sn7MLjG+biEL5anaJ/CD4Y45KdeUctwwkVKmY6PRopaxRMg/eUI2EBTZ jtZtUDZJihDCuRHly103QnZcu46/ki/0I00IEEe+PLBq1T40xRePtwXLv/n/uhn28jPC 4S8DTvCrisV/mW2SlBMh4fHsBks53BeAc6I6R85Z+fY//3Ibe8k712fq3JVfNGkhFMMi RCLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=N1SQinY5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 62si7413174plc.87.2019.02.15.22.41.39; Fri, 15 Feb 2019 22:41:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=N1SQinY5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732877AbfBOTRO (ORCPT + 99 others); Fri, 15 Feb 2019 14:17:14 -0500 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:51358 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726654AbfBOTRO (ORCPT ); Fri, 15 Feb 2019 14:17:14 -0500 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id D65C98EE235; Fri, 15 Feb 2019 11:17:13 -0800 (PST) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Tr1HqR5hTIJi; Fri, 15 Feb 2019 11:17:13 -0800 (PST) Received: from [153.66.254.194] (unknown [50.35.68.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 4BB708EE10C; Fri, 15 Feb 2019 11:17:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1550258233; bh=ZcQo684pyd8jOtiDQZLm9UhOtL4FAORSIvKrJR1kZ3A=; h=Subject:From:To:Cc:Date:From; b=N1SQinY5xadTWYJLZ8Thkmhl8NjxqOwhbrI+jGAyBkHNDvoEJj5gsXTuyiubmTAEW 55YNGi3gdL2XzFGEuaRwJxqfyr7EVAFSEJQpwZKh8vRGQJAGYi3rK6o3xYfkDGpVH5 tJ2G6L/UN8jaKtCbsJMlXwPD76h6yjtfGAvVFKGw= Message-ID: <1550258231.3406.15.camel@HansenPartnership.com> Subject: [GIT PULL] SCSI fixes for 5.0-rc From: James Bottomley To: Andrew Morton , Linus Torvalds Cc: linux-scsi , linux-kernel Date: Fri, 15 Feb 2019 11:17:11 -0800 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. The patch is available here: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes The short changelog is: Bill Kuzeja (1): scsi: qla2xxx: Fix panic from use after free in qla2x00_async_tm_cmd James Bottomley (1): scsi: sd: fix entropy gathering for most rotational disks And the diffstat: drivers/scsi/qla2xxx/qla_init.c | 4 ++-- drivers/scsi/sd.c | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) With full diff below. James --- diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 364bb52ed2a6..109587e62983 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, /* Issue Marker IOCB */ qla2x00_marker(vha, vha->hw->req_q_map[0], - vha->hw->rsp_q_map[0], sp->fcport->loop_id, lun, + vha->hw->rsp_q_map[0], fcport->loop_id, lun, flags == TCF_LUN_RESET ? MK_SYNC_ID_LUN : MK_SYNC_ID); } done_free_sp: sp->free(sp); - sp->fcport->flags &= ~FCF_ASYNC_SENT; + fcport->flags &= ~FCF_ASYNC_SENT; done: return rval; } 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) if (rot == 1) { blk_queue_flag_set(QUEUE_FLAG_NONROT, q); blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, q); - } else { - blk_queue_flag_clear(QUEUE_FLAG_NONROT, q); - blk_queue_flag_set(QUEUE_FLAG_ADD_RANDOM, q); } if (sdkp->device->type == TYPE_ZBC) { @@ -3090,6 +3087,15 @@ static int sd_revalidate_disk(struct gendisk *disk) if (sdkp->media_present) { sd_read_capacity(sdkp, buffer); + /* + * set the default to rotational. All non-rotational devices + * support the block characteristics VPD page, which will + * cause this to be updated correctly and any device which + * doesn't support it should be treated as rotational. + */ + blk_queue_flag_clear(QUEUE_FLAG_NONROT, q); + blk_queue_flag_set(QUEUE_FLAG_ADD_RANDOM, q); + if (scsi_device_supports_vpd(sdp)) { sd_read_block_provisioning(sdkp); sd_read_block_limits(sdkp);