diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-29 15:19:34 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-29 15:19:34 -0400 |
| commit | 1895679334371c5a89dd5cb715c980ade6559c72 (patch) | |
| tree | 2bc3a8483b5d55c7451476ea7a256ad84261bd79 /kernel/gsp_sema_service.c | |
| parent | 1df5ff4729a6ad2d93bdd8707c0837e3bf9581b6 (diff) | |
| download | open-iov-1895679334371c5a89dd5cb715c980ade6559c72.tar.gz open-iov-1895679334371c5a89dd5cb715c980ade6559c72.zip | |
sema-svc: never apply swept-page releases with no live channel (guest boot corruption); tooling guards
Diffstat (limited to 'kernel/gsp_sema_service.c')
| -rw-r--r-- | kernel/gsp_sema_service.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c index ae8f7da..b29e833 100644 --- a/kernel/gsp_sema_service.c +++ b/kernel/gsp_sema_service.c @@ -2668,6 +2668,29 @@ static u32 svc_apply_page_data(struct nv_vgpu_device *vgpu, const u8 *buf, u64 pa_page) { u32 off, applied = 0; + bool any = false; + unsigned long flags; + int ci; + + /* + * No live channel: no client can be waiting on a release, so a + * "release" decoded from an arbitrary swept page can only be a false + * positive, and its write lands through whatever translation the VA + * happens to have (observed: 2 applied writes while the guest kernel + * was booting corrupted a task's CPU field and panicked the guest + * scheduler). Only apply swept-page releases while a client exists; + * real releases are carried by the channels' readable pushes then. + */ + spin_lock_irqsave(&svc.chan_lock, flags); + for (ci = 0; ci < SVC_MAX_CHANNELS; ci++) { + if (svc.chan[ci].valid) { + any = true; + break; + } + } + spin_unlock_irqrestore(&svc.chan_lock, flags); + if (!any) + return 0; /* * Decoded execution: walk the page as a method stream and perform the |
