- pget()/pfind() will acquire the PID hash bucket locks, which are sleepable locks, but this means that the sigio mutex cannot be held while calling these functions. Instead, use pget() to hold the process, after which we lock the sigio and proc locks, respectively. - funsetownlst() assumes that processes cannot be registered for SIGIO once they have P_WEXIT set. However, pfind() will happily return exiting processes. Add an explicit check for P_WEXIT in fsetown() to fix this.
Fixes: f52979098d3c ("Fix a pair of races in SIGIO registration")
Reported by: syzkaller