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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090616203906.4526.40945.stgit@warthog.procyon.org.uk>
Date:	Tue, 16 Jun 2009 21:39:06 +0100
From:	David Howells <dhowells@...hat.com>
To:	torvalds@...l.org, akpm@...ux-foundation.org
Cc:	linux-kernel@...r.kernel.org, linux-afs@...ts.infradead.org,
	linux-fsdevel@...r.kernel.org, Wang Lei <wang840925@...il.com>,
	David Howells <dhowells@...hat.com>
Subject: [PATCH 04/17] AFS: Add key request for pioctl

From: Wang Lei <wang840925@...il.com>

afs_pioctl() should get the security key applicable to the nominated file and
pass it on to the command handlers.

Signed-off-by: Wang Lei <wang840925@...il.com>
Signed-off-by: David Howells <dhowells@...hat.com>
---

 fs/afs/pioctl.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)


diff --git a/fs/afs/pioctl.c b/fs/afs/pioctl.c
index 5a76017..63a6211 100644
--- a/fs/afs/pioctl.c
+++ b/fs/afs/pioctl.c
@@ -17,9 +17,28 @@
  */
 long afs_pioctl(struct dentry *dentry, int cmd, struct vice_ioctl *arg)
 {
+	struct afs_vnode *vnode = AFS_FS_I(dentry->d_inode);
+	struct key *key;
+	long ret;
+
+	_enter(",%x(%d),{%d,%d}",
+	       cmd, _IOC_NR(cmd), arg->in_size, arg->out_size);
+
+	key = afs_request_key(vnode->volume->cell);
+	if (IS_ERR(key)) {
+		ret = PTR_ERR(key);
+		_leave(" = %ld [no key]", ret);
+		return ret;
+	}
+
 	switch (cmd) {
 	default:
 		printk(KERN_DEBUG "AFS: Unsupported pioctl command %x\n", cmd);
-		return -EOPNOTSUPP;
+		ret = -EOPNOTSUPP;
+		break;
 	}
+
+	key_put(key);
+	_leave(" = %ld", ret);
+	return ret;
 }

--
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