Skip to contentSkip to conversation

+ signal-move-print_dropped_signal.patch added to -mm tree

DISCUSSION Oleg Nesterov 1 participant 1 message Jan 3, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20200102215029.PWaCMXI_O%[email protected]

#1 lore raw
Quoted 4 lines

From: Tom Rix <[email protected]>
Subject: kernel/signal.c: move print_dropped_signal

If the allocation of 'q' fails, the signal will be dropped.

Well, not necessarily... See the comment above TRACE_SIGNAL_LOSE_INFO in __send_signal().

Quoted 3 lines

To ensure
that this is reported, move print_dropped_signal to be inside the '(q == NULL)' if-check.

OK, but print_dropped_signal() says "reached RLIMIT_SIGPENDING", this is misleading if kmem_cache_alloc() fails.

Quoted 36 lines
Cc "Eric W. Biederman" <[email protected]>
Cc Christian Brauner <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Roman Gushchin <[email protected]>
Cc Deepa Dinamani <[email protected]>
Cc Oleg Nesterov <[email protected]>

---

 kernel/signal.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/signal.c renamed from kernel/signal.c~signal-move-print_dropped_signal +1 -2
@@ -427,11 +427,10 @@ __sigqueue_alloc(int sig, struct task_st
 	    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 {

_

Patches currently in -mm which might be from [email protected] are

signal-move-print_dropped_signal.patch