diff options
| author | Daehyeon Ko <4ncienth@gmail.com> | 2026-10-19 17:43:49 +0900 |
|---|---|---|
| committer | Wei Liu <wei.liu@kernel.org> | 2026-10-21 13:58:26 -0700 |
| commit | 70cd4623f3e5068a72c72791b96f2dcb4c991131 (patch) | |
| tree | ceba64a5e7c41e17359624ec0236cd17e4cc2891 /scripts/basic/split-include.c | |
| parent | efc5dc4c15713fdd6e87882686a26ed1deb22dab (diff) | |
| download | linux-70cd4623f3e5068a72c72791b96f2dcb4c991131.tar.gz linux-70cd4623f3e5068a72c72791b96f2dcb4c991131.zip | |
mshv_vtl: reject poll files with multiple waitqueues
MSHV_SET_POLL_FILE invokes a file descriptor poll callback with a poll
table backed by a single embedded wait entry. A poll callback may,
however, register the table with more than one waitqueue. pipe_poll()
does this naturally for an O_RDWR FIFO.
The second registration currently warns but then inserts the same list
node into another list. The new insertion overwrites the entry links while
the first waitqueue still points at it, corrupting the first waitqueue and
causing an invalid callback traversal when that queue wakes.
Reject a second distinct waitqueue, remove the first registration through
the common removal helper, and return -EINVAL from the ioctl. Repeated
registration of the same waitqueue is treated as a no-op. A rejected
replacement leaves the CPU slot unregistered, consistent with the existing
remove-before-register ordering. Single-waitqueue users such as the OpenHCL
io_uring poll file keep their existing behavior.
An LLM assisted the source audit, fix development, and validation of this
issue.
Fixes: 7bfe3b8ea6e3 ("Drivers: hv: Introduce mshv_vtl driver")
Cc: stable@vger.kernel.org
Signed-off-by: Daehyeon Ko <4ncienth@gmail.com>
Reviewed-by: Naman Jain <namjain@linux.microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Diffstat (limited to 'scripts/basic/split-include.c')
0 files changed, 0 insertions, 0 deletions
