Skip to content

Commit 1b02caa

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Two bug fixes, both for fairly serious problems; the UFS one looks like it could be used to exfiltrate data from the kernel, although probably only a privileged user has access to the command management interface and the missing unlock in smartpqi is long standing and probably a little used error path" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: smartpqi: unlock on error in pqi_submit_raid_request_synchronous() scsi: ufs: Check that space was properly alloced in copy_query_response
2 parents 0ad43e2 + cc8f526 commit 1b02caa

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

‎drivers/scsi/smartpqi/smartpqi_init.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4046,8 +4046,10 @@ static int pqi_submit_raid_request_synchronous(struct pqi_ctrl_info *ctrl_info,
40464046
return -ETIMEDOUT;
40474047
msecs_blocked =
40484048
jiffies_to_msecs(jiffies - start_jiffies);
4049-
if (msecs_blocked >= timeout_msecs)
4050-
return -ETIMEDOUT;
4049+
if (msecs_blocked >= timeout_msecs) {
4050+
rc = -ETIMEDOUT;
4051+
goto out;
4052+
}
40514053
timeout_msecs -= msecs_blocked;
40524054
}
40534055
}

‎drivers/scsi/ufs/ufshcd.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1917,7 +1917,8 @@ int ufshcd_copy_query_response(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
19171917
memcpy(&query_res->upiu_res, &lrbp->ucd_rsp_ptr->qr, QUERY_OSF_SIZE);
19181918

19191919
/* Get the descriptor */
1920-
if (lrbp->ucd_rsp_ptr->qr.opcode == UPIU_QUERY_OPCODE_READ_DESC) {
1920+
if (hba->dev_cmd.query.descriptor &&
1921+
lrbp->ucd_rsp_ptr->qr.opcode == UPIU_QUERY_OPCODE_READ_DESC) {
19211922
u8 *descp = (u8 *)lrbp->ucd_rsp_ptr +
19221923
GENERAL_UPIU_REQUEST_SIZE;
19231924
u16 resp_len;

0 commit comments

Comments
 (0)