Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 25 Sep 2013 21:14:38 +0100
From: Djalal Harouni <>
To: "Eric W. Biederman" <>,
	Kees Cook <>,
	Al Viro <>,
	Andrew Morton <>,
	Linus Torvalds <>,
	Ingo Molnar <>,
	"Serge E. Hallyn" <>,
	Cyrill Gorcunov <>,
	LKML <>,,
	Djalal Harouni <>
Subject: [PATCH 05/12] seq_file: set the seq_file->f_cred during seq_open()

The f_cred field of the file struct contains the cred of current at
open time. This field can be used to get the context of open, and track
current's cred changes after.
The procfs is one of those fs that need to track current cred changes
in order to implement proper permission checks on each system call.

Set the seq_file->f_cred to file->f_cred during seq_open().

Cc: Kees Cook <>
Cc: Eric W. Biederman <>
Signed-off-by: Djalal Harouni <>
 fs/seq_file.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/seq_file.c b/fs/seq_file.c
index 3135c25..a5e5b98 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -57,6 +57,7 @@ int seq_open(struct file *file, const struct seq_operations *op)
 	memset(p, 0, sizeof(*p));
 	p->op = op;
+	p->f_cred = file->f_cred;
 	p->user_ns = file->f_cred->user_ns;

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.