All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/7] iommufd: Fix bugs in eventq fops_read paths
@ 2026-06-01 20:42 Nicolin Chen
  2026-06-01 20:42 ` [PATCH v1 1/7] iommufd: Rewind header length in done if iommufd_veventq_fops_read() fails Nicolin Chen
                   ` (9 more replies)
  0 siblings, 10 replies; 18+ messages in thread
From: Nicolin Chen @ 2026-06-01 20:42 UTC (permalink / raw)
  To: jgg, kevin.tian; +Cc: joro, baolu.lu, iommu, linux-kernel, linux-kselftest

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
-- 
2.43.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2026-06-05 14:30 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-01 20:42 [PATCH v1 0/7] iommufd: Fix bugs in eventq fops_read paths Nicolin Chen
2026-06-01 20:42 ` [PATCH v1 1/7] iommufd: Rewind header length in done if iommufd_veventq_fops_read() fails Nicolin Chen
2026-06-03 14:01   ` Pranjal Shrivastava
2026-06-01 20:42 ` [PATCH v1 2/7] iommufd: Reject invalid read count in iommufd_veventq_fops_read() Nicolin Chen
2026-06-03 14:08   ` Pranjal Shrivastava
2026-06-01 20:42 ` [PATCH v1 3/7] iommufd: Propagate allocation failure in iommufd_veventq_deliver_fetch() Nicolin Chen
2026-06-03 14:13   ` Pranjal Shrivastava
2026-06-01 20:42 ` [PATCH v1 4/7] iommufd: Reject invalid read count in iommufd_fault_fops_read() Nicolin Chen
2026-06-03 14:15   ` Pranjal Shrivastava
2026-06-01 20:42 ` [PATCH v1 5/7] iommufd: Break the loop on failure " Nicolin Chen
2026-06-03 14:18   ` Pranjal Shrivastava
2026-06-01 20:42 ` [PATCH v1 6/7] iommufd: Avoid partial fault group delivery " Nicolin Chen
2026-06-03 14:26   ` Pranjal Shrivastava
2026-06-01 20:42 ` [PATCH v1 7/7] iommufd/selftest: Cover invalid read counts on vEVENTQ FD Nicolin Chen
2026-06-03 14:46   ` Pranjal Shrivastava
2026-06-02  6:27 ` [PATCH v1 0/7] iommufd: Fix bugs in eventq fops_read paths Nicolin Chen
2026-06-03  6:59 ` Tian, Kevin
2026-06-05 14:30 ` Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.