From: David Howells <dhowells@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: linux-security-module@vger.kernel.org,
David Howells <dhowells@redhat.com>,
Serge Hallyn <serue@us.ibm.com>,
Eric Van Hensbergen <ericvh@gmail.com>,
Ron Minnich <rminnich@sandia.gov>,
Latchesar Ionkov <lucho@ionkov.net>,
v9fs-developer@lists.sourceforge.net
Subject: [PATCH 14/59] CRED: Wrap task credential accesses in 9P2000 filesystem
Date: Wed, 27 Aug 2008 14:46:54 +0100 [thread overview]
Message-ID: <20080827134654.19980.45849.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20080827134541.19980.61042.stgit@warthog.procyon.org.uk>
Wrap access to task credentials so that they can be separated more easily from
the task_struct during the introduction of COW creds.
Change most current->(|e|s|fs)[ug]id to current_(|e|s|fs)[ug]id().
Change some task->e?[ug]id to task_e?[ug]id(). In some places it makes more
sense to use RCU directly rather than a convenient wrapper; these will be
addressed by later patches.
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Ron Minnich <rminnich@sandia.gov>
Cc: Latchesar Ionkov <lucho@ionkov.net>
Cc: v9fs-developer@lists.sourceforge.net
---
fs/9p/fid.c | 2 +-
fs/9p/vfs_inode.c | 4 ++--
fs/9p/vfs_super.c | 4 ++--
net/9p/client.c | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/9p/fid.c b/fs/9p/fid.c
index 3031e32..a43e4ab 100644
--- a/fs/9p/fid.c
+++ b/fs/9p/fid.c
@@ -120,7 +120,7 @@ struct p9_fid *v9fs_fid_lookup(struct dentry *dentry)
switch (access) {
case V9FS_ACCESS_SINGLE:
case V9FS_ACCESS_USER:
- uid = current->fsuid;
+ uid = current_fsuid();
any = 0;
break;
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index c95295c..517dd27 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -215,8 +215,8 @@ struct inode *v9fs_get_inode(struct super_block *sb, int mode)
inode = new_inode(sb);
if (inode) {
inode->i_mode = mode;
- inode->i_uid = current->fsuid;
- inode->i_gid = current->fsgid;
+ inode->i_uid = current_fsuid();
+ inode->i_gid = current_fsgid();
inode->i_blocks = 0;
inode->i_rdev = 0;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index bf59c39..f59ffcd 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -113,8 +113,8 @@ static int v9fs_get_sb(struct file_system_type *fs_type, int flags,
struct v9fs_session_info *v9ses = NULL;
struct p9_stat *st = NULL;
int mode = S_IRWXUGO | S_ISVTX;
- uid_t uid = current->fsuid;
- gid_t gid = current->fsgid;
+ uid_t uid = current_fsuid();
+ gid_t gid = current_fsgid();
struct p9_fid *fid;
int retval = 0;
diff --git a/net/9p/client.c b/net/9p/client.c
index 2ffe40c..a5dfc17 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -1049,7 +1049,7 @@ static struct p9_fid *p9_fid_create(struct p9_client *clnt)
fid->rdir_fpos = 0;
fid->rdir_pos = 0;
fid->rdir_fcall = NULL;
- fid->uid = current->fsuid;
+ fid->uid = current_fsuid();
fid->clnt = clnt;
fid->aux = NULL;
next prev parent reply other threads:[~2008-08-27 13:49 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-27 13:45 [PATCH 00/59] Introduce credentials David Howells
2008-08-27 13:33 ` Alan Cox
2008-08-27 13:45 ` [PATCH 01/59] CRED: Wrap task credential accesses in the IA64 arch David Howells
2008-08-27 14:55 ` Artem Bityutskiy
2008-08-27 15:24 ` David Howells
2008-08-27 23:21 ` Stephen Rothwell
2008-08-27 13:45 ` [PATCH 02/59] CRED: Wrap task credential accesses in the MIPS arch David Howells
2008-08-27 13:45 ` [PATCH 03/59] CRED: Wrap task credential accesses in the PA-RISC arch David Howells
2008-08-27 22:19 ` Kyle McMartin
2008-08-27 13:46 ` [PATCH 04/59] CRED: Wrap task credential accesses in the PowerPC arch David Howells
2008-08-27 23:45 ` Benjamin Herrenschmidt
2008-08-27 13:46 ` [PATCH 05/59] CRED: Wrap task credential accesses in the S390 arch David Howells
2008-08-27 13:46 ` [PATCH 06/59] CRED: Wrap task credential accesses in the x86 arch David Howells
2008-08-27 13:46 ` [PATCH 07/59] CRED: Wrap task credential accesses in the block loopback driver David Howells
2008-08-27 13:46 ` [PATCH 08/59] CRED: Wrap task credential accesses in the tty driver David Howells
2008-08-27 13:46 ` [PATCH 09/59] CRED: Wrap task credential accesses in the DRM driver David Howells
2008-09-02 1:03 ` Dave Airlie
2008-08-27 13:46 ` [PATCH 10/59] CRED: Wrap task credential accesses in the ISDN drivers David Howells
2008-08-27 17:51 ` Karsten Keil
2008-08-27 13:46 ` [PATCH 11/59] CRED: Wrap task credential accesses in video input drivers David Howells
2008-08-29 22:32 ` Mauro Carvalho Chehab
2008-08-27 13:46 ` [PATCH 12/59] CRED: Wrap task credential accesses in the network device drivers David Howells
2008-08-27 13:46 ` [PATCH 13/59] CRED: Wrap task credential accesses in the USB driver David Howells
2008-08-27 13:46 ` David Howells [this message]
2008-08-28 17:59 ` [PATCH 14/59] CRED: Wrap task credential accesses in 9P2000 filesystem Eric Van Hensbergen
2008-08-27 13:46 ` [PATCH 15/59] CRED: Wrap task credential accesses in the AFFS filesystem David Howells
2008-08-27 13:47 ` [PATCH 16/59] CRED: Wrap task credential accesses in the autofs filesystem David Howells
2008-08-27 13:47 ` [PATCH 17/59] CRED: Wrap task credential accesses in the autofs4 filesystem David Howells
2008-08-27 13:47 ` [PATCH 18/59] CRED: Wrap task credential accesses in the BFS filesystem David Howells
2008-08-27 13:47 ` [PATCH 19/59] CRED: Wrap task credential accesses in the CIFS filesystem David Howells
2008-08-27 13:47 ` [PATCH 20/59] CRED: Wrap task credential accesses in the Coda filesystem David Howells
2008-08-27 13:47 ` [PATCH 21/59] CRED: Wrap task credential accesses in the devpts filesystem David Howells
2008-08-27 13:47 ` [PATCH 22/59] CRED: Wrap task credential accesses in the eCryptFS filesystem David Howells
2008-08-27 13:47 ` [PATCH 23/59] CRED: Wrap task credential accesses in the Ext2 filesystem David Howells
2008-08-27 13:47 ` [PATCH 24/59] CRED: Wrap task credential accesses in the Ext3 filesystem David Howells
2008-08-27 13:47 ` [PATCH 25/59] CRED: Wrap task credential accesses in the Ext4 filesystem David Howells
2008-08-27 13:47 ` [PATCH 26/59] CRED: Wrap task credential accesses in the FAT filesystem David Howells
2008-08-27 14:12 ` OGAWA Hirofumi
2008-08-27 13:48 ` [PATCH 27/59] CRED: Wrap task credential accesses in the FUSE filesystem David Howells
2008-08-27 13:48 ` [PATCH 28/59] CRED: Wrap task credential accesses in the GFS2 filesystem David Howells
2008-08-27 13:48 ` [PATCH 29/59] CRED: Wrap task credential accesses in the HFS filesystem David Howells
2008-08-27 13:48 ` [PATCH 30/59] CRED: Wrap task credential accesses in the HFSplus filesystem David Howells
2008-08-27 13:48 ` [PATCH 31/59] CRED: Wrap task credential accesses in the HPFS filesystem David Howells
2008-08-27 13:48 ` [PATCH 32/59] CRED: Wrap task credential accesses in the hugetlbfs filesystem David Howells
2008-08-27 13:48 ` [PATCH 33/59] CRED: Wrap task credential accesses in the JFFS2 filesystem David Howells
2008-08-27 13:48 ` [PATCH 34/59] CRED: Wrap task credential accesses in the JFS filesystem David Howells
2008-08-27 14:31 ` Dave Kleikamp
2008-08-27 13:48 ` [PATCH 35/59] CRED: Wrap task credential accesses in the Minix filesystem David Howells
2008-08-27 13:48 ` [PATCH 36/59] CRED: Wrap task credential accesses in the NCPFS filesystem David Howells
2008-08-27 13:48 ` [PATCH 37/59] CRED: Wrap task credential accesses in the NFS daemon David Howells
2008-08-27 13:48 ` [PATCH 38/59] CRED: Wrap task credential accesses in the OCFS2 filesystem David Howells
2008-08-27 23:04 ` Mark Fasheh
2008-08-27 13:49 ` [PATCH 39/59] CRED: Wrap task credential accesses in the OMFS filesystem David Howells
2008-08-27 13:49 ` [PATCH 40/59] CRED: Wrap task credential accesses in the RAMFS filesystem David Howells
2008-08-27 13:49 ` [PATCH 41/59] CRED: Wrap task credential accesses in the ReiserFS filesystem David Howells
2008-08-27 13:49 ` [PATCH 42/59] CRED: Wrap task credential accesses in the SMBFS filesystem David Howells
2008-08-27 13:49 ` [PATCH 43/59] CRED: Wrap task credential accesses in the SYSV filesystem David Howells
2008-08-27 13:49 ` [PATCH 44/59] CRED: Wrap task credential accesses in the UBIFS filesystem David Howells
2008-08-27 13:49 ` [PATCH 45/59] CRED: Wrap task credential accesses in the UDF filesystem David Howells
2008-08-27 14:44 ` Jan Kara
2008-08-27 13:49 ` [PATCH 46/59] CRED: Wrap task credential accesses in the UFS filesystem David Howells
2008-08-27 13:49 ` [PATCH 47/59] CRED: Wrap task credential accesses in the XFS filesystem David Howells
2008-08-27 13:49 ` [PATCH 48/59] CRED: Wrap task credential accesses in the filesystem subsystem David Howells
2008-08-27 13:49 ` [PATCH 49/59] CRED: Wrap task credential accesses in the SYSV IPC subsystem David Howells
2008-08-27 13:50 ` [PATCH 50/59] CRED: Wrap task credential accesses in the AX25 protocol David Howells
2008-08-27 13:50 ` [PATCH 51/59] CRED: Wrap task credential accesses in the IPv6 protocol David Howells
2008-08-27 13:50 ` [PATCH 52/59] CRED: Wrap task credential accesses in the netrom protocol David Howells
2008-08-27 13:50 ` [PATCH 53/59] CRED: Wrap task credential accesses in the ROSE protocol David Howells
2008-08-27 13:50 ` [PATCH 54/59] CRED: Wrap task credential accesses in the SunRPC protocol David Howells
2008-08-27 13:50 ` [PATCH 55/59] CRED: Wrap task credential accesses in the UNIX socket protocol David Howells
2008-08-27 13:50 ` [PATCH 56/59] CRED: Wrap task credential accesses in the networking subsystem David Howells
2008-08-27 13:50 ` [PATCH 57/59] CRED: Wrap task credential accesses in the key management code David Howells
2008-08-27 13:50 ` [PATCH 58/59] CRED: Wrap task credential accesses in the capabilities code David Howells
2008-08-27 13:50 ` [PATCH 59/59] CRED: Wrap task credential accesses in the core kernel David Howells
2008-08-27 14:24 ` [PATCH 00/59] Introduce credentials David Howells
2008-08-27 16:39 ` Alan Cox
2008-08-28 9:19 ` David Howells
2008-08-28 9:45 ` Alan Cox
2008-08-28 20:28 ` Paul E. McKenney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080827134654.19980.45849.stgit@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=ericvh@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=lucho@ionkov.net \
--cc=rminnich@sandia.gov \
--cc=serue@us.ibm.com \
--cc=v9fs-developer@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®