Re: [PATCH] futex: use fault_in to avoid infinite loop
From: Peter Zijlstra
Date: Wed Dec 06 2017 - 11:04:18 EST
On Wed, Dec 06, 2017 at 10:21:07PM +0800, Cheng Jian wrote:
> It will cause softlockup(infinite loop) in kernel
> space when we use SYS_set_robust_list in futex which
> incoming a misaligned address from user space.
Urgh, we should not allow that in the first place.
See how get_futex_key() does:
if (unlikely(address % sizeof(u32)))
return -EINVAL;
That same should also be true for the robust list. Using unaligned
variables is insane.