lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Tue,  3 Dec 2019 10:02:21 -0800
From:   trix@...hat.com
To:     ebiederm@...ssion.com, christian.brauner@...ntu.com, arnd@...db.de,
        akpm@...ux-foundation.org, guro@...com, deepa.kernel@...il.com,
        linux-kernel@...r.kernel.org
Cc:     Tom Rix <trix@...hat.com>
Subject: [PATCH] signal: move print_dropped_signal

From: Tom Rix <trix@...hat.com>

If the allocation of 'q' fails, the signal will be dropped.
To ensure that this is reported, move print_dropped_signal to be
inside the '(q == NULL)' if-check.

Signed-off-by: Tom Rix <trix@...hat.com>
---
 kernel/signal.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index bcd46f547db3..294a4625200e 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -427,11 +427,10 @@ __sigqueue_alloc(int sig, struct task_struct *t, gfp_t flags, int override_rlimi
 	    atomic_read(&user->sigpending) <=
 			task_rlimit(t, RLIMIT_SIGPENDING)) {
 		q = kmem_cache_alloc(sigqueue_cachep, flags);
-	} else {
-		print_dropped_signal(sig);
 	}
 
 	if (unlikely(q == NULL)) {
+		print_dropped_signal(sig);
 		atomic_dec(&user->sigpending);
 		free_uid(user);
 	} else {
-- 
2.18.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ