]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ecryptfs: discard ecryptfsd registration messages in miscdev
authorTyler Hicks <tyhicks@linux.vnet.ibm.com>
Thu, 24 Jul 2008 04:30:04 +0000 (21:30 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Jul 2008 17:47:31 +0000 (10:47 -0700)
The userspace eCryptfs daemon sends HELO and QUIT messages to the kernel
for per-user daemon (un)registration.  These messages are required when
netlink is used as the transport, but (un)registration is handled by
opening and closing the device file when miscdev is the transport.  These
messages should be discarded in the miscdev transport so that a daemon
isn't registered twice.

Signed-off-by: Tyler Hicks <tyhicks@linux.vnet.ibm.com>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ecryptfs/miscdev.c

index 09a4522f65e6c26311bd896b515b20faf516a025..b484792a0996c0623b08f054f86c06214da47b3f 100644 (file)
@@ -357,46 +357,6 @@ out_unlock_daemon:
        return rc;
 }
 
-/**
- * ecryptfs_miscdev_helo
- * @euid: effective user id of miscdevess sending helo packet
- * @user_ns: The namespace in which @euid applies
- * @pid: miscdevess id of miscdevess sending helo packet
- *
- * Returns zero on success; non-zero otherwise
- */
-static int ecryptfs_miscdev_helo(uid_t euid, struct user_namespace *user_ns,
-                                struct pid *pid)
-{
-       int rc;
-
-       rc = ecryptfs_process_helo(ECRYPTFS_TRANSPORT_MISCDEV, euid, user_ns,
-                                  pid);
-       if (rc)
-               printk(KERN_WARNING "Error processing HELO; rc = [%d]\n", rc);
-       return rc;
-}
-
-/**
- * ecryptfs_miscdev_quit
- * @euid: effective user id of miscdevess sending quit packet
- * @user_ns: The namespace in which @euid applies
- * @pid: miscdevess id of miscdevess sending quit packet
- *
- * Returns zero on success; non-zero otherwise
- */
-static int ecryptfs_miscdev_quit(uid_t euid, struct user_namespace *user_ns,
-                                struct pid *pid)
-{
-       int rc;
-
-       rc = ecryptfs_process_quit(euid, user_ns, pid);
-       if (rc)
-               printk(KERN_WARNING
-                      "Error processing QUIT message; rc = [%d]\n", rc);
-       return rc;
-}
-
 /**
  * ecryptfs_miscdev_response - miscdevess response to message previously sent to daemon
  * @data: Bytes comprising struct ecryptfs_message
@@ -512,26 +472,7 @@ ecryptfs_miscdev_write(struct file *file, const char __user *buf,
                               __func__, rc);
                break;
        case ECRYPTFS_MSG_HELO:
-               rc = ecryptfs_miscdev_helo(current->euid,
-                                          current->nsproxy->user_ns,
-                                          task_pid(current));
-               if (rc) {
-                       printk(KERN_ERR "%s: Error attempting to process "
-                              "helo from pid [0x%p]; rc = [%d]\n", __func__,
-                              task_pid(current), rc);
-                       goto out_free;
-               }
-               break;
        case ECRYPTFS_MSG_QUIT:
-               rc = ecryptfs_miscdev_quit(current->euid,
-                                          current->nsproxy->user_ns,
-                                          task_pid(current));
-               if (rc) {
-                       printk(KERN_ERR "%s: Error attempting to process "
-                              "quit from pid [0x%p]; rc = [%d]\n", __func__,
-                              task_pid(current), rc);
-                       goto out_free;
-               }
                break;
        default:
                ecryptfs_printk(KERN_WARNING, "Dropping miscdev "