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. |
The regenerated patch carries three lines of context so a moved anchor can be refused, but prepare() used patch(1)'s default fuzz of 2, which accepts a hunk on a single matching context line. Mutating one context line in the pinned source still applied 0005 "with fuzz 1"; at fuzz zero it fails, which is the point of the context. Both patches apply at fuzz zero against the commit the PKGBUILD pins, so nothing legitimate is refused. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Re-reviewed at Everything below ran on a disposable Omarchy worker VM (kernel 7.1.9-arch1-2, The four previous findings, each checked by execution.
One thing pushed: A second bug this patch closes that neither of us named. Pre-patch, The one that is not your bug, and is the reason to be careful about This is pre-existing and shipping today: pre-patch, a But it changes how the What could not be tested at all: there is no IPU7 hardware here. No Permissions re-checked, and this time run. There is exactly one PSYS rules file now — On whether this locks the camera out: Also verified: all 24 source entries have 24 checksums, all 19 non- Still open from last time: no aggregate pin limit or locked-memory accounting. Each Second opinion: codex at xhigh reviewed this independently. The Waiting on you for whether the |
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.