Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: reject promises in the arguments to syscall.callNow()
Vats which hold device nodes (`d-NN` references) can use `syscall.callNow()` on them, to make a synchronous invocation (which can return data). The outbound arguments and return data are capdata, which is translated through c-lists just like regular `syscall.send()` and promise resolution. However devices do not (currently) handle Promises at all. The kernel-to-device c-list translation will panic the kernel if asked to translate a promise reference (`kpNN`). Vats should not be able to panic the kernel, even if we give them access to a device node. This changes the vat-to-kernel translator to reject promise references in the arguments of `callNow`, making it a vat-fatal error. This will terminate the vat, but leave the kernel running. In the long run (#1346), devices should accept Promises, but it will take more work (and probably require devices to operate on a much lower level than vats do). But this should fix the immediate kernel panic. Note that killing a vat is not exactly friendly either. The bug described in issue #1358 was triggered by user REPL input causing the HTTP vat to try sending a Promise into the Command device, killing the kernel. With this change, this will instead kill the HTTP vat, which breaks the REPL, rendering the system mostly unusable. But at least the attribution is correct. We have another fix in the works that will change liveslots.js to catch this situation during the call to `D(devnode).methname(args)`, which should reduce the blast radius to merely throw an exception in `D()`, rather than killing the whole vat. refs #1358
- Loading branch information