signal: Properly set TRACE_SIGNAL_LOSE_INFO in __send_signal
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 16 May 2019 03:56:17 +0000 (22:56 -0500)
committerEric W. Biederman <ebiederm@xmission.com>
Wed, 29 May 2019 14:31:43 +0000 (09:31 -0500)
Any time siginfo is not stored in the signal queue information is
lost.  Therefore set TRACE_SIGNAL_LOSE_INFO every time the code does
not allocate a signal queue entry, and a queue overflow abort is not
triggered.

Fixes: ba005e1f4172 ("tracepoint: Add signal loss events")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
kernel/signal.c

index d92b636b4e9d5ae8346e9e0b2754420b06752b29..b2f0cf3a68aa166ee4ef7c26cc5483a2924c40db 100644 (file)
@@ -1131,23 +1131,22 @@ static int __send_signal(int sig, struct kernel_siginfo *info, struct task_struc
                        copy_siginfo(&q->info, info);
                        break;
                }
-       } else if (!is_si_special(info)) {
-               if (sig >= SIGRTMIN && info->si_code != SI_USER) {
-                       /*
-                        * Queue overflow, abort.  We may abort if the
-                        * signal was rt and sent by user using something
-                        * other than kill().
-                        */
-                       result = TRACE_SIGNAL_OVERFLOW_FAIL;
-                       ret = -EAGAIN;
-                       goto ret;
-               } else {
-                       /*
-                        * This is a silent loss of information.  We still
-                        * send the signal, but the *info bits are lost.
-                        */
-                       result = TRACE_SIGNAL_LOSE_INFO;
-               }
+       } else if (!is_si_special(info) &&
+                  sig >= SIGRTMIN && info->si_code != SI_USER) {
+               /*
+                * Queue overflow, abort.  We may abort if the
+                * signal was rt and sent by user using something
+                * other than kill().
+                */
+               result = TRACE_SIGNAL_OVERFLOW_FAIL;
+               ret = -EAGAIN;
+               goto ret;
+       } else {
+               /*
+                * This is a silent loss of information.  We still
+                * send the signal, but the *info bits are lost.
+                */
+               result = TRACE_SIGNAL_LOSE_INFO;
        }
 
 out_set: