signal: Properly set TRACE_SIGNAL_LOSE_INFO in __send_signal

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: ba005e1f41 ("tracepoint: Add signal loss events")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
Eric W. Biederman 2019-05-15 22:56:17 -05:00
parent 2e1661d267
commit 8917bef336

View file

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