protect the fetch of ->fd[fd] in do_dup2() from mispredictions
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 8280d16172243702ed43432f826ca6130edb4086 · < da72e783afd27d9f487836b2e6738146c0edd149| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
protect the fetch of ->fd[fd] in do_dup2() from mispredictions
both callers have verified that fd is not greater than ->max_fds; however, misprediction might end up with tofree = fdt->fd[fd]; being speculatively executed. That's wrong for the same reasons why it's wrong in close_fd()/file_close_fd_locked(); the same solution applies - array_index_nospec(fd, fdt->max_fds) could differ from fd only in case of speculative execution on mispredicted path.
From the CVE record · Linux
The Linux kernel’s do_dup2() can speculatively read outside the file descriptor array after a branch misprediction, despite callers checking the descriptor against the array limit. The input does not specify an attacker outcome or whether exploitation requires local access, authentication, or user interaction.
Engineers running the Linux kernel should check their versions; affected versions are not specified in the input.