Re: [PATCH] fs/select: reject negative timeval components in kern_select()

From: Christian Brauner

Date: Tue May 12 2026 - 09:07:04 EST


On Wed, 29 Apr 2026 06:09:37 -0700, Breno Leitao wrote:
> kern_select() normalises the user-supplied struct __kernel_old_timeval
> with
>
> tv.tv_sec + (tv.tv_usec / USEC_PER_SEC)
> (tv.tv_usec % USEC_PER_SEC) * NSEC_PER_USEC
>
> before calling poll_select_set_timeout() -> timespec64_valid(). Both
> operands of the seconds sum are unbounded user-controlled signed long.
> A crafted pair where tv_usec is a negative multiple of USEC_PER_SEC
> drives the sum across the wrap boundary - e.g.
>
> [...]

Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes

[1/1] fs/select: reject negative timeval components in kern_select()
https://git.kernel.org/vfs/vfs/c/859c199bb3a9