4 ms·
The `abs_time` argument to both the futex_wait and new futex_wait_multiple is a pointer, but nowhere is the address checked for validity. (Tracing the syscall p
by wahern 7y ago
The `abs_time` argument to both the futex_wait and new futex_wait_multiple is a pointer, but nowhere is the address checked for validity. (Tracing the syscall path, it seems to be dereferenced in futex_setup_timer without any validity check beforehand.) It's never written to AFAICT, only loaded, but it still seems like leaving around a loaded gun. More importantly, couldn't this unchecked address be used to probe kernel memory to test for values like NULL, or possibly any value with enough sampling?
Note that the futex address itself is also a pointer, but it's validated with access_ok in get_futex_key.
- monocasa 7y agoIt's not a user pointer, it's a pointer to the kernel stack that's constructed here: https://elixir.bootlin.com/linux/latest/source/kernel/futex.c#L3675 https://elixir.bootlin.com/linux/latest/source/kernel/futex....