Skip to content

Commit 211b100

Browse files
committed
Merge tag 'for-linus-20180920' of git://git.kernel.dk/linux-block
Jens writes: "Storage fixes for 4.19-rc5 - Fix for leaking kernel pointer in floppy ioctl (Andy Whitcroft) - NVMe pull request from Christoph, and a single ANA log page fix (Hannes) - Regression fix for libata qd32 support, where we trigger an illegal active command transition. This fixes a CD-ROM detection issue that was reported, but could also trigger premature completion of the internal tag (me)" * tag 'for-linus-20180920' of git://git.kernel.dk/linux-block: floppy: Do not copy a kernel pointer to user memory in FDGETPRM ioctl libata: mask swap internal and hardware tag nvme: count all ANA groups for ANA Log page
2 parents a38fd7d + d611aaf commit 211b100

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

drivers/ata/libata-core.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5359,10 +5359,20 @@ void ata_qc_complete(struct ata_queued_cmd *qc)
53595359
*/
53605360
int ata_qc_complete_multiple(struct ata_port *ap, u64 qc_active)
53615361
{
5362+
u64 done_mask, ap_qc_active = ap->qc_active;
53625363
int nr_done = 0;
5363-
u64 done_mask;
53645364

5365-
done_mask = ap->qc_active ^ qc_active;
5365+
/*
5366+
* If the internal tag is set on ap->qc_active, then we care about
5367+
* bit0 on the passed in qc_active mask. Move that bit up to match
5368+
* the internal tag.
5369+
*/
5370+
if (ap_qc_active & (1ULL << ATA_TAG_INTERNAL)) {
5371+
qc_active |= (qc_active & 0x01) << ATA_TAG_INTERNAL;
5372+
qc_active ^= qc_active & 0x01;
5373+
}
5374+
5375+
done_mask = ap_qc_active ^ qc_active;
53665376

53675377
if (unlikely(done_mask & qc_active)) {
53685378
ata_port_err(ap, "illegal qc_active transition (%08llx->%08llx)\n",

drivers/block/floppy.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3467,6 +3467,9 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int
34673467
(struct floppy_struct **)&outparam);
34683468
if (ret)
34693469
return ret;
3470+
memcpy(&inparam.g, outparam,
3471+
offsetof(struct floppy_struct, name));
3472+
outparam = &inparam.g;
34703473
break;
34713474
case FDMSGON:
34723475
UDP->flags |= FTD_MSG;

drivers/nvme/target/admin-cmd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ static void nvmet_execute_get_log_page_ana(struct nvmet_req *req)
245245
offset += len;
246246
ngrps++;
247247
}
248+
for ( ; grpid <= NVMET_MAX_ANAGRPS; grpid++) {
249+
if (nvmet_ana_group_enabled[grpid])
250+
ngrps++;
251+
}
248252

249253
hdr.chgcnt = cpu_to_le64(nvmet_ana_chgcnt);
250254
hdr.ngrps = cpu_to_le16(ngrps);

0 commit comments

Comments
 (0)