Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 11 Mar 2012 00:25:12 +0100
From: Djalal Harouni <>
	Andrew Morton <>,
	Linus Torvalds <>,
	Al Viro <>,
	Alexey Dobriyan <>,
	"Eric W. Biederman" <>,
	Vasiliy Kulikov <>,
	Kees Cook <>,
	Solar Designer <>,
	WANG Cong <>,
	James Morris <>,
	Oleg Nesterov <>,,
Cc: Alan Cox <>,
	Greg KH <>,
	Ingo Molnar <>,
	Stephen Wilson <>,
	"Jason A. Donenfeld" <>,
	Djalal Harouni <>,
	Vasiliy Kulikov <>,
	Solar Designer <>
Subject: [PATCH 2/9] proc: add proc_file_private struct to store private information

In order to store and to track the private information specific to each
procfs opened file we convert the 'proc_maps_private' struct which is used
by the /proc/$pid/{maps,smaps,numa_maps} files to 'proc_file_private'
which can now be used by all the /proc/<pid>/* and even other /proc/* files
to store private information that must be kept across syscalls.

The proc_file_private struct includes an exec_id member which can be used
to track and to protect special and sensitive procfs files. In general it
will be set at open time to the task's exec_id to bind the file to this

The proc_file_private struct offers the way to make the checks and to
bind special procfs files to the appropriate task in a consistent and
unified way.

Cc: Vasiliy Kulikov <>
Cc: Solar Designer <>
Signed-off-by: Djalal Harouni <>
 fs/proc/internal.h |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/fs/proc/internal.h b/fs/proc/internal.h
index 2925775..a8968f6 100644
--- a/fs/proc/internal.h
+++ b/fs/proc/internal.h
@@ -61,10 +61,19 @@ extern const struct file_operations proc_pagemap_operations;
 extern const struct file_operations proc_net_operations;
 extern const struct inode_operations proc_net_inode_operations;
-struct proc_maps_private {
+ * Internal proc_file_private is used to track procfs files being
+ * processed especially the ones that varies during runtime.
+ */
+struct proc_file_private {
+	/* The Execve ID of the task, use this to protect special procfs
+	 * files. Must be set at open time. */
+	u64 exec_id;
 	struct pid *pid;
+	struct inode *inode;
 	struct task_struct *task;
 #ifdef CONFIG_MMU
+	/* For /proc/pid/{maps,smaps...} */
 	struct vm_area_struct *tail_vma;

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.