iommufd: Fix bugs in eventq fops_read paths
Status from this message: Applied to for-next
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | iommufd: Rewind header length in done if iommufd_veventq_fops_read() failsdrivers/ | +1 | 1 reply | |
| 2/7 | iommufd: Reject invalid read count in iommufd_veventq_fops_read()drivers/ | +6 | 1 reply | |
| 3/7 | iommufd: Propagate allocation failure in iommufd_veventq_deliver_fetch()drivers/ | +9 | 1 reply | |
| 4/7 | iommufd: Reject invalid read count in iommufd_fault_fops_read()drivers/ | +3 | 1 reply | |
| 5/7 | iommufd: Break the loop on failure in iommufd_fault_fops_read()drivers/ | +2 | 1 reply | |
| 6/7 | iommufd: Avoid partial fault group delivery in iommufd_fault_fops_read()drivers/ | +5 | 1 reply | |
| 7/7 | iommufd/selftest: Cover invalid read counts on vEVENTQ FDtools/ | +17 | 1 reply |
Reviews trailers per patch
All 7 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Kevin Tian | Pranjal Shrivastava |
|---|---|---|
| Series | R-b | |
| 1/7 | R-b | |
| 2/7 | R-b | |
| 3/7 | R-b | |
| 4/7 | R-b | |
| 5/7 | R-b | |
| 6/7 | R-b | |
| 7/7 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v1 0/7] iommufd: Fix bugs in eventq fops_read paths
Bugs were found in iommufd_veventq/fault_fops_read(), where userspace may:
- Receive a corrupted byte stream after a partial copy_to_user
- Spin in a poll/read loop when reading with an undersized buffer
- Miss notifications when the kernel cannot allocate a lost-events copy
- Receive duplicate faults with stale cookies after a mid-group failure
- Cause the kernel to retry the same failed copy_to_user indefinitely
Fix them, then add selftest coverage for the vEVENTQ count validation.
This is on github:
https://github.com/nicolinc/iommufd/commits/fix_eventq_read_bugs-v1
Rebased on Jason's for-next tree with the veventq_depth series applied.
Nicolin Chen (7):
iommufd: Rewind header length in done if iommufd_veventq_fops_read()
fails
iommufd: Reject invalid read count in iommufd_veventq_fops_read()
iommufd: Propagate allocation failure in
iommufd_veventq_deliver_fetch()
iommufd: Reject invalid read count in iommufd_fault_fops_read()
iommufd: Break the loop on failure in iommufd_fault_fops_read()
iommufd: Avoid partial fault group delivery in
iommufd_fault_fops_read()
iommufd/selftest: Cover invalid read counts on vEVENTQ FD
drivers/iommu/iommufd/eventq.c | 29 ++++++++++++++++++++++--- tools/testing/selftests/iommu/iommufd.c | 17 +++++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-)
base-commit: f25989c19028e8bf81e26e1133a99e3436c3afc2
Signature · 1 line
2.43.0