Fix signal delivery might be on sigfastblock clearing.
When clearing sigfastblock, either by sigfastblock(UNSETPTR) call or implicitly on execve(2), kernel must check for pending signals and reschedule them if needed. E.g. on execve, all other threads are terminated, and current thread fast block pointer is cleaned. If any signal was left pending, it can now be delivered to the current thread, and we should prepare for ast() on return to userspace to notice the signals. Reported and tested by: pho Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
762b178152
commit
7024c3cc79
@ -4107,7 +4107,8 @@ sigfastblock_clear(struct thread *td)
|
||||
if ((td->td_pflags & TDP_SIGFASTBLOCK) == 0)
|
||||
return;
|
||||
td->td_sigblock_val = 0;
|
||||
resched = (td->td_pflags & TDP_SIGFASTPENDING) != 0;
|
||||
resched = (td->td_pflags & TDP_SIGFASTPENDING) != 0 ||
|
||||
SIGPENDING(td);
|
||||
td->td_pflags &= ~(TDP_SIGFASTBLOCK | TDP_SIGFASTPENDING);
|
||||
if (resched) {
|
||||
p = td->td_proc;
|
||||
|
Loading…
x
Reference in New Issue
Block a user