All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] race condition in procfs
@ 2005-11-29  7:17 Grzegorz Nosek
  2005-11-29  8:09 ` Andrew Morton
  0 siblings, 1 reply; 22+ messages in thread
From: Grzegorz Nosek @ 2005-11-29  7:17 UTC (permalink / raw)
  To: linux-kernel

Hello,

I found a race condition in procfs on SMP systems. The result is an
oops in processes like pidof. Apparently ->proc_read() gets passed a
potentially NULL pointer. The following micro-patch seems to fix it.

Best regards,
 Grzegorz Nosek

--- linux-2.6/fs/proc/base.c.orig 2005-11-25 00:07:43.000000000 +0100
+++ linux-2.6/fs/proc/base.c      2005-11-28 11:44:11.000000000 +0100
@@ -718,6 +718,9 @@
       ssize_t length;
       struct task_struct *task = proc_task(inode);

+       if (!task)
+               return -ENOENT;
+
       if (count > PROC_BLOCK_SIZE)
               count = PROC_BLOCK_SIZE;
       if (!(page = __get_free_page(GFP_KERNEL)))

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2005-12-13 18:25 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-29  7:17 [PATCH] race condition in procfs Grzegorz Nosek
2005-11-29  8:09 ` Andrew Morton
2005-11-29  8:38   ` Grzegorz Nosek
2005-11-29 13:25     ` Grzegorz Nosek
2005-11-29 14:04       ` Grzegorz Nosek
2005-11-29 14:28         ` Steven Rostedt
2005-11-29 14:39           ` Grzegorz Nosek
2005-11-29 14:49             ` Steven Rostedt
2005-11-30 14:41               ` Grzegorz Nosek
2005-11-30 15:14                 ` Steven Rostedt
2005-11-30 15:29                   ` Grzegorz Nosek
2005-11-30 16:25                     ` Steven Rostedt
2005-11-30 17:23                       ` Grzegorz Nosek
2005-12-01 20:38                         ` Grzegorz Nosek
2005-11-29 15:22   ` [PATCH] shrinks dentry struct Eric Dumazet
2005-11-30  2:06     ` Paul Jackson
2005-11-30  2:14       ` Andrew Morton
2005-11-30  2:43         ` Paul Jackson
2005-11-30  6:56         ` Hugh Dickins
2005-12-03  1:15     ` [PATCH] remove unused blkp field in percpu_data Eric Dumazet
2005-12-13 18:03     ` [PATCH] shrinks dentry struct Paul E. McKenney
2005-12-13 18:24       ` Eric Dumazet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.