Harden IPU7 PSYS userptr pinning - #264
Conversation
|
Reviewed. The bug you are closing is real and worse than the PR body claims, the fix is correct against the pinned source, and there are two packaging problems worth addressing before this lands. What was actually checked. I read the patch against the real driver source at the commit this PKGBUILD pins ( What class of bug this closes. The part worth being clear about: this does not require the attacker to own 2 TiB of memory. GUP writes pointers as it pins and returns a short count, and the old Which is also why, of the two halves of this PR, the udev and tmpfiles change is doing at least as much work as the C: The fix itself reads correct. Applied against the pinned source it produces the expected function: length validated before any arithmetic, One thing I suspected and could not make stick, recorded so nobody re-treads it: Two packaging problems:
Permissions check out. Not addressed, and pre-existing: there is still no aggregate pin limit or locked-memory accounting. Each On PR #271 ( An upstream backport should name its commit, and this one does not. The patch header ( Second opinion: codex at xhigh reviewed this independently. It contributed the short-count exploitation mechanism above, which changed my conclusion about severity; it disproved the use-after-free I suspected in Nothing was pushed to this branch: the patch format and the install-script behaviour are both your calls to make rather than mine to make for you. Waiting on the author. |
What
FOLL_FORCE, require a complete long-term pin, clean up partial pins, and publish attachment state only after SG creation succeeds.video/seat-scoped access.checkpatch.pl, and an actual DKMS module build fromcheck().Why
The original driver narrows an attacker-controlled 64-bit length into signed page-count and allocation-size integers. A crafted request can therefore allocate space for one page pointer before
pin_user_pages_fast()writes multiple pointers into that allocation. The package also exposed the PSYS device as mode0666, making the ioctl reachable by every local account on affected hardware.Review follow-up
--fuzz=0fail.intel-ipu7-psys.ko, rather than relying only on source greps and a duplicate arithmetic model.Verification
--fuzz=0.checkpatch.pl --no-tree --strict --no-signoff: 0 errors and 0 warnings.check()flow passes its ordinary, oversized, wrapping, and zero-length boundary cases.intel-ipu7-psys.ko, build successfully against Arch Linux 7.1.9 headers.linux-ptl7.2.2 headers as an artifact, so compatibility with that unmerged kernel remains unverified.The audit host has no IPU7 hardware, so the real ioctl was not executed against a live device/KASAN kernel. The finding is a source-confirmed kernel memory-safety defect, not a demonstrated end-to-end root exploit.
Deployment
The upgrade immediately attempts to remove world access from an existing device. If permission refresh fails, the scriptlet emits a reboot-before-use warning and continues the remaining lifecycle work. If
intel_ipu7_psysis already loaded, reboot is required to replace the running module with the fixed build.