IOCTL_EVTCHN_RESTRICT limits the file descriptor to being able to bind to interdomain event channels from a specific domain. Event channels that are already bound continue to work for sending and receiving notifications. This is useful as part of deprivileging a user space PV backend or device model (QEMU). e.g., Once the device model as bound to the ioreq server event channels it can restrict the file handle so an exploited DM cannot use it to create or bind to arbitrary event channels.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -85,4 +85,19 @@ struct ioctl_evtchn_notify { · 84 unmodified lines | ||
| 85 | 85 | #define IOCTL_EVTCHN_RESET \ |
| 86 | 86 | _IOC(_IOC_NONE, 'E', 5, 0) |
| 87 | 87 | |
| 88 | +/* | |
| 89 | + * Restrict this file descriptor so that it can only be used to bind | |
| 90 | + * new interdomain events from one domain. | |
| 91 | + * | |
| 92 | + * Once a file descriptor has been restricted it cannot be | |
| 93 | + * de-restricted, and must be closed and re-opened. Event channels | |
| 94 | + * which were bound before restricting remain bound afterwards, and | |
| 95 | + * can be notified as usual. | |
| 96 | + */ | |
| 97 | +#define IOCTL_EVTCHN_RESTRICT_DOMID \ | |
| 98 | + _IOC(_IOC_NONE, 'E', 6, sizeof(struct ioctl_evtchn_restrict_domid)) | |
| 99 | +struct ioctl_evtchn_restrict_domid { | |
| 100 | + domid_t domid; | |
| 101 | +}; | |
| 102 | + | |
| 88 | 103 | #endif /* __LINUX_PUBLIC_EVTCHN_H__ */ |