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]
Message-ID: <1484238380.15816.42.camel@edumazet-glaptop3.roam.corp.google.com>
Date:   Thu, 12 Jan 2017 08:26:20 -0800
From:   Eric Dumazet <eric.dumazet@...il.com>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>
Subject: [PATCH] proc: add a schedule point in proc_pid_readdir()

From: Eric Dumazet <edumazet@...gle.com>

We have seen proc_pid_readdir() invocations holding cpu for more
than 50 ms. Add a cond_resched() to be gentle with other tasks.

Signed-off-by: Eric Dumazet <edumazet@...gle.com>
---
 fs/proc/base.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 8e7e61b28f31..f204f80d397b 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -3179,6 +3179,7 @@ int proc_pid_readdir(struct file *file, struct dir_context *ctx)
 	     iter.tgid += 1, iter = next_tgid(ns, iter)) {
 		char name[PROC_NUMBUF];
 		int len;
+		cond_resched();
 		if (!has_pid_permissions(ns, iter.task, 2))
 			continue;
 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ