diff mbox series

syscalls/pidfd_send_signal: Use local pointer to verify signal data

Message ID 31b0bde3ac9d0e617c2878a9b4ae1e1dc1f39c10.1584515853.git.viresh.kumar@linaro.org
State Accepted
Headers show
Series syscalls/pidfd_send_signal: Use local pointer to verify signal data | expand

Commit Message

Viresh Kumar March 18, 2020, 7:18 a.m. UTC
The current check, uinfo->si_value.sival_int == DATA, will always
evaluate to true as we are checking uinfo by mistake instead of the
pointer passed to the callback. Fix it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 .../kernel/syscalls/pidfd_send_signal/pidfd_send_signal01.c     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Li Wang March 18, 2020, 7:54 a.m. UTC | #1
On Wed, Mar 18, 2020 at 3:18 PM Viresh Kumar <viresh.kumar@linaro.org>
wrote:

> The current check, uinfo->si_value.sival_int == DATA, will always
> evaluate to true as we are checking uinfo by mistake instead of the
> pointer passed to the callback. Fix it.
>

Pushed. Thanks for the fix.
diff mbox series

Patch

diff --git a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal01.c b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal01.c
index 64dddad6643a..3137b6967371 100644
--- a/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal01.c
+++ b/testcases/kernel/syscalls/pidfd_send_signal/pidfd_send_signal01.c
@@ -26,7 +26,7 @@  static int pidfd;
 static void received_signal(int sig, siginfo_t *info, void *ucontext)
 {
 	if (info && ucontext) {
-		if (sig == SIGNAL && uinfo->si_value.sival_int == DATA) {
+		if (sig == SIGNAL && info->si_value.sival_int == DATA) {
 			tst_res(TPASS, "Received correct signal and data!");
 			sig_rec = 1;
 		} else {