Eric W. Biederman 84fe4cc09a signal: Don't send signals to tasks that don't exist
Recently syzbot reported crashes in send_sigio_to_task and
send_sigurg_to_task in linux-next.  Despite finding a reproducer
syzbot apparently did not bisected this or otherwise track down the
offending commit in linux-next.

I happened to see this report and examined the code because I had
recently changed these functions as part of making PIDTYPE_TGID a real
pid type so that fork would does not need to restart when receiving a
signal.  By examination I see that I spotted a bug in the code
that could explain the reported crashes.

When I took Oleg's suggestion and optimized send_sigurg and send_sigio
to only send to a single task when type is PIDTYPE_PID or PIDTYPE_TGID
I failed to handle pids that no longer point to tasks.  The macro
do_each_pid_task simply iterates for zero iterations.  With pid_task
an explicit NULL test is needed.

Update the code to include the missing NULL test.

Fixes: 019191342fec ("signal: Use PIDTYPE_TGID to clearly store where file signals will be sent")
Reported-by: syzkaller-bugs@googlegroups.com
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2018-08-15 23:03:20 -05:00
..
2018-06-12 16:19:22 -07:00
2018-06-11 10:16:13 -07:00
2018-03-14 13:31:23 +01:00
2018-06-15 07:55:24 +09:00
2018-03-27 13:18:09 -04:00
2018-05-22 14:27:52 -04:00
2018-05-22 14:27:52 -04:00
2018-05-21 14:30:09 -04:00
2018-05-22 14:27:53 -04:00
2018-06-15 18:11:26 -03:00
2018-06-07 17:34:40 -07:00
2018-06-05 19:23:26 +02:00
2018-06-08 17:21:52 -07:00
2018-06-14 20:09:28 -04:00
2018-07-21 10:43:12 -05:00
2018-05-03 16:11:37 -06:00
2018-06-12 15:49:00 -07:00
2018-06-11 08:22:34 -07:00
2018-02-15 15:34:42 -05:00
2018-05-26 09:16:44 +02:00
2018-04-04 12:44:02 -07:00
2018-05-26 09:16:44 +02:00