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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20071012160630.15119.20074.stgit@warthog.procyon.org.uk>
Date:	Fri, 12 Oct 2007 17:06:30 +0100
From:	David Howells <dhowells@...hat.com>
To:	viro@....linux.org.uk
Cc:	kwc@...i.umich.edu, Trond.Myklebust@...app.com,
	linux-kernel@...r.kernel.org, dhowells@...hat.com
Subject: [PATCH 14/52] CRED: Provide a writeback credentials record

Provide a set of credentials specifically for the writeback functions.  Since
writeback may well occur in some other process context than the original write
into the pagecache, the current process's credentials are not applicable, and
so there are used instead.

If writeback needs to know the credentials, then those credentials should be
cached by prepare_write(), page_mkwrite() or similar.  Filesystems such as NFS
and AFS need to do this as they need to communicate to a remote store the
appropriate security details under which the write should be made.
Filesystems such as Ext3 should perform allocation and reservation checks
before letting the write to the pagecache occur.

Signed-off-by: David Howells <dhowells@...hat.com>
---

 fs/buffer.c          |    2 +-
 fs/mpage.c           |    2 +-
 include/linux/cred.h |    1 +
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index bb6ab45..0c8444a 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -1599,7 +1599,7 @@ EXPORT_SYMBOL(unmap_underlying_metadata);
 static int __block_write_full_page(struct inode *inode, struct page *page,
 			get_block_t *get_block, struct writeback_control *wbc)
 {
-	struct cred *cred = current->cred;
+	struct cred *cred = &writeback_cred;
 	int err;
 	sector_t block;
 	sector_t last_block;
diff --git a/fs/mpage.c b/fs/mpage.c
index af97410..c04672d 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -457,7 +457,7 @@ struct mpage_data {
 static int __mpage_writepage(struct page *page, struct writeback_control *wbc,
 			     void *data)
 {
-	struct cred *cred = current->cred;
+	struct cred *cred = &writeback_cred;
 	struct mpage_data *mpd = data;
 	struct bio *bio = mpd->bio;
 	struct address_space *mapping = page->mapping;
diff --git a/include/linux/cred.h b/include/linux/cred.h
index 6ec0132..46f4a64 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -29,6 +29,7 @@ struct cred {
 };
 
 extern struct cred init_cred;
+#define writeback_cred init_cred
 
 struct inode;
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ