Skip to content

ide: Fix incorrect handling of some PRDTs and add the corresponding unit-test

Alexander Popov qemu-devel 1 version Applied

Status from this message: Thanks, applied to my IDE tree:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest2 patches 10 repliesApplied

Changes in v3 from the cover letter

- the assertion about prepare_buf() return value is improved;
- the patch order is reversed to keep the tree bisectable;
- the unit-test performance is improved -- now it runs 8 seconds instead of 3 minutes on my laptop.

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/2ide: Fix incorrect handling of some PRDTs in ide_dma_cb()hw/ide/core.c+22 -81 reply
2/2tests/ide-test: Create a single unit-test covering more PRDT casestests/ide-test.c+74 -1003 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchKevin Wolf
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] ide: Fix incorrect handling of some PRDTs and add the corresponding unit-test

Fuzzing the Linux kernel with syzkaller allowed to find how to crash qemu using a special SCSI_IOCTL_SEND_COMMAND. It hits the assertion in ide_dma_cb() introduced in the commit a718978ed58a in July 2015.

This patch series fixes incorrect handling of some PRDTs in ide_dma_cb() and improves the ide-test to cover more PRDT cases (including one that causes that particular qemu crash).

Changes from v2 (thanks to Kevin Wolf for the feedback):
- the assertion about prepare_buf() return value is improved;
- the patch order is reversed to keep the tree bisectable;
- the unit-test performance is improved -- now it runs 8 seconds instead of 3 minutes on my laptop.

Alexander Popov (2):
ide: Fix incorrect handling of some PRDTs in ide_dma_cb() tests/ide-test: Create a single unit-test covering more PRDT cases

 hw/ide/core.c    |  30 +++++---
 tests/ide-test.c | 174 ++++++++++++++++++++---------------------------
 2 files changed, 96 insertions(+), 108 deletions(-)
Signature · 1 line
2.23.0