blob: c6ac85d6c701f5b7d82e069c9a3f82a67a51d0b3 [file] [log] [blame]
Michael Halcrow237fead2006-10-04 02:16:22 -07001/**
2 * eCryptfs: Linux filesystem encryption layer
3 *
4 * Copyright (C) 1997-2003 Erez Zadok
5 * Copyright (C) 2001-2003 Stony Brook University
Michael Halcrowdd2a3b72007-02-12 00:53:46 -08006 * Copyright (C) 2004-2007 International Business Machines Corp.
Michael Halcrow237fead2006-10-04 02:16:22 -07007 * Author(s): Michael A. Halcrow <mahalcro@us.ibm.com>
8 * Michael C. Thompson <mcthomps@us.ibm.com>
Michael Halcrowdddfa462007-02-12 00:53:44 -08009 * Tyler Hicks <tyhicks@ou.edu>
Michael Halcrow237fead2006-10-04 02:16:22 -070010 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of the
14 * License, or (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24 * 02111-1307, USA.
25 */
26
27#include <linux/dcache.h>
28#include <linux/file.h>
29#include <linux/module.h>
30#include <linux/namei.h>
31#include <linux/skbuff.h>
32#include <linux/crypto.h>
Michael Halcrow237fead2006-10-04 02:16:22 -070033#include <linux/mount.h>
Michael Halcrow237fead2006-10-04 02:16:22 -070034#include <linux/pagemap.h>
35#include <linux/key.h>
36#include <linux/parser.h>
Josef "Jeff" Sipek0cc72dc2006-12-08 02:36:31 -080037#include <linux/fs_stack.h>
Mimi Zohar36520be2009-10-05 14:25:44 -040038#include <linux/ima.h>
Michael Halcrow237fead2006-10-04 02:16:22 -070039#include "ecryptfs_kernel.h"
40
41/**
42 * Module parameter that defines the ecryptfs_verbosity level.
43 */
44int ecryptfs_verbosity = 0;
45
46module_param(ecryptfs_verbosity, int, 0);
47MODULE_PARM_DESC(ecryptfs_verbosity,
48 "Initial verbosity level (0 or 1; defaults to "
49 "0, which is Quiet)");
50
Michael Halcrowdddfa462007-02-12 00:53:44 -080051/**
Tyler Hicks624ae522008-10-15 22:02:51 -070052 * Module parameter that defines the number of message buffer elements
Michael Halcrowdddfa462007-02-12 00:53:44 -080053 */
54unsigned int ecryptfs_message_buf_len = ECRYPTFS_DEFAULT_MSG_CTX_ELEMS;
55
56module_param(ecryptfs_message_buf_len, uint, 0);
57MODULE_PARM_DESC(ecryptfs_message_buf_len,
58 "Number of message buffer elements");
59
60/**
61 * Module parameter that defines the maximum guaranteed amount of time to wait
Tyler Hicks624ae522008-10-15 22:02:51 -070062 * for a response from ecryptfsd. The actual sleep time will be, more than
Michael Halcrowdddfa462007-02-12 00:53:44 -080063 * likely, a small amount greater than this specified value, but only less if
Tyler Hicks624ae522008-10-15 22:02:51 -070064 * the message successfully arrives.
Michael Halcrowdddfa462007-02-12 00:53:44 -080065 */
66signed long ecryptfs_message_wait_timeout = ECRYPTFS_MAX_MSG_CTX_TTL / HZ;
67
68module_param(ecryptfs_message_wait_timeout, long, 0);
69MODULE_PARM_DESC(ecryptfs_message_wait_timeout,
70 "Maximum number of seconds that an operation will "
71 "sleep while waiting for a message response from "
72 "userspace");
73
74/**
75 * Module parameter that is an estimate of the maximum number of users
76 * that will be concurrently using eCryptfs. Set this to the right
77 * value to balance performance and memory use.
78 */
79unsigned int ecryptfs_number_of_users = ECRYPTFS_DEFAULT_NUM_USERS;
80
81module_param(ecryptfs_number_of_users, uint, 0);
82MODULE_PARM_DESC(ecryptfs_number_of_users, "An estimate of the number of "
83 "concurrent users of eCryptfs");
84
Michael Halcrow237fead2006-10-04 02:16:22 -070085void __ecryptfs_printk(const char *fmt, ...)
86{
87 va_list args;
88 va_start(args, fmt);
89 if (fmt[1] == '7') { /* KERN_DEBUG */
90 if (ecryptfs_verbosity >= 1)
91 vprintk(fmt, args);
92 } else
93 vprintk(fmt, args);
94 va_end(args);
95}
96
97/**
Michael Halcrow4981e082007-10-16 01:28:09 -070098 * ecryptfs_init_persistent_file
99 * @ecryptfs_dentry: Fully initialized eCryptfs dentry object, with
100 * the lower dentry and the lower mount set
101 *
102 * eCryptfs only ever keeps a single open file for every lower
103 * inode. All I/O operations to the lower inode occur through that
104 * file. When the first eCryptfs dentry that interposes with the first
105 * lower dentry for that inode is created, this function creates the
106 * persistent file struct and associates it with the eCryptfs
107 * inode. When the eCryptfs inode is destroyed, the file is closed.
108 *
109 * The persistent file will be opened with read/write permissions, if
110 * possible. Otherwise, it is opened read-only.
111 *
112 * This function does nothing if a lower persistent file is already
113 * associated with the eCryptfs inode.
114 *
115 * Returns zero on success; non-zero otherwise
116 */
Michael Halcrow72b55ff2008-07-23 21:30:07 -0700117int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry)
Michael Halcrow4981e082007-10-16 01:28:09 -0700118{
David Howells745ca242008-11-14 10:39:22 +1100119 const struct cred *cred = current_cred();
Michael Halcrow4981e082007-10-16 01:28:09 -0700120 struct ecryptfs_inode_info *inode_info =
121 ecryptfs_inode_to_private(ecryptfs_dentry->d_inode);
Mimi Zohar36520be2009-10-05 14:25:44 -0400122 int opened_lower_file = 0;
Michael Halcrow4981e082007-10-16 01:28:09 -0700123 int rc = 0;
124
125 mutex_lock(&inode_info->lower_file_mutex);
126 if (!inode_info->lower_file) {
127 struct dentry *lower_dentry;
128 struct vfsmount *lower_mnt =
129 ecryptfs_dentry_to_lower_mnt(ecryptfs_dentry);
130
131 lower_dentry = ecryptfs_dentry_to_lower(ecryptfs_dentry);
Michael Halcrow746f1e52008-07-23 21:30:02 -0700132 rc = ecryptfs_privileged_open(&inode_info->lower_file,
David Howells745ca242008-11-14 10:39:22 +1100133 lower_dentry, lower_mnt, cred);
Tyler Hicksac22ba22009-08-12 01:06:54 -0500134 if (rc) {
Michael Halcrow4981e082007-10-16 01:28:09 -0700135 printk(KERN_ERR "Error opening lower persistent file "
Michael Halcrow746f1e52008-07-23 21:30:02 -0700136 "for lower_dentry [0x%p] and lower_mnt [0x%p]; "
137 "rc = [%d]\n", lower_dentry, lower_mnt, rc);
Michael Halcrow4981e082007-10-16 01:28:09 -0700138 inode_info->lower_file = NULL;
Mimi Zohar36520be2009-10-05 14:25:44 -0400139 } else
140 opened_lower_file = 1;
Michael Halcrow4981e082007-10-16 01:28:09 -0700141 }
142 mutex_unlock(&inode_info->lower_file_mutex);
Mimi Zohar36520be2009-10-05 14:25:44 -0400143 if (opened_lower_file)
144 ima_counts_get(inode_info->lower_file);
Michael Halcrow4981e082007-10-16 01:28:09 -0700145 return rc;
146}
147
148/**
Michael Halcrow237fead2006-10-04 02:16:22 -0700149 * ecryptfs_interpose
150 * @lower_dentry: Existing dentry in the lower filesystem
151 * @dentry: ecryptfs' dentry
152 * @sb: ecryptfs's super_block
Michael Halcrow72b55ff2008-07-23 21:30:07 -0700153 * @flags: flags to govern behavior of interpose procedure
Michael Halcrow237fead2006-10-04 02:16:22 -0700154 *
155 * Interposes upper and lower dentries.
156 *
157 * Returns zero on success; non-zero otherwise
158 */
159int ecryptfs_interpose(struct dentry *lower_dentry, struct dentry *dentry,
Michael Halcrow72b55ff2008-07-23 21:30:07 -0700160 struct super_block *sb, u32 flags)
Michael Halcrow237fead2006-10-04 02:16:22 -0700161{
162 struct inode *lower_inode;
163 struct inode *inode;
164 int rc = 0;
165
166 lower_inode = lower_dentry->d_inode;
167 if (lower_inode->i_sb != ecryptfs_superblock_to_lower(sb)) {
168 rc = -EXDEV;
169 goto out;
170 }
171 if (!igrab(lower_inode)) {
172 rc = -ESTALE;
173 goto out;
174 }
175 inode = iget5_locked(sb, (unsigned long)lower_inode,
176 ecryptfs_inode_test, ecryptfs_inode_set,
177 lower_inode);
178 if (!inode) {
179 rc = -EACCES;
180 iput(lower_inode);
181 goto out;
182 }
183 if (inode->i_state & I_NEW)
184 unlock_new_inode(inode);
185 else
186 iput(lower_inode);
187 if (S_ISLNK(lower_inode->i_mode))
188 inode->i_op = &ecryptfs_symlink_iops;
189 else if (S_ISDIR(lower_inode->i_mode))
190 inode->i_op = &ecryptfs_dir_iops;
191 if (S_ISDIR(lower_inode->i_mode))
192 inode->i_fop = &ecryptfs_dir_fops;
Pekka Enberg26da8202006-10-19 23:28:14 -0700193 if (special_file(lower_inode->i_mode))
Michael Halcrow237fead2006-10-04 02:16:22 -0700194 init_special_inode(inode, lower_inode->i_mode,
195 lower_inode->i_rdev);
196 dentry->d_op = &ecryptfs_dops;
Josef "Jeff" Sipek0cc72dc2006-12-08 02:36:31 -0800197 fsstack_copy_attr_all(inode, lower_inode, NULL);
Michael Halcrow237fead2006-10-04 02:16:22 -0700198 /* This size will be overwritten for real files w/ headers and
199 * other metadata */
Josef "Jeff" Sipek0cc72dc2006-12-08 02:36:31 -0800200 fsstack_copy_inode_size(inode, lower_inode);
Tyler Hicksae6e8452009-03-12 00:19:46 -0500201 if (flags & ECRYPTFS_INTERPOSE_FLAG_D_ADD)
202 d_add(dentry, inode);
203 else
204 d_instantiate(dentry, inode);
Michael Halcrow237fead2006-10-04 02:16:22 -0700205out:
206 return rc;
207}
208
Eric Sandeen2830bfd2008-02-06 01:38:34 -0800209enum { ecryptfs_opt_sig, ecryptfs_opt_ecryptfs_sig,
210 ecryptfs_opt_cipher, ecryptfs_opt_ecryptfs_cipher,
211 ecryptfs_opt_ecryptfs_key_bytes,
Michael Halcrow17398952007-02-12 00:53:45 -0800212 ecryptfs_opt_passthrough, ecryptfs_opt_xattr_metadata,
Michael Halcrow87c94c42009-01-06 14:42:01 -0800213 ecryptfs_opt_encrypted_view, ecryptfs_opt_fnek_sig,
214 ecryptfs_opt_fn_cipher, ecryptfs_opt_fn_cipher_key_bytes,
Tyler Hickse77cc8d2009-04-22 04:08:46 -0500215 ecryptfs_opt_unlink_sigs, ecryptfs_opt_err };
Michael Halcrow237fead2006-10-04 02:16:22 -0700216
Steven Whitehousea447c092008-10-13 10:46:57 +0100217static const match_table_t tokens = {
Michael Halcrow237fead2006-10-04 02:16:22 -0700218 {ecryptfs_opt_sig, "sig=%s"},
219 {ecryptfs_opt_ecryptfs_sig, "ecryptfs_sig=%s"},
Michael Halcrow237fead2006-10-04 02:16:22 -0700220 {ecryptfs_opt_cipher, "cipher=%s"},
221 {ecryptfs_opt_ecryptfs_cipher, "ecryptfs_cipher=%s"},
222 {ecryptfs_opt_ecryptfs_key_bytes, "ecryptfs_key_bytes=%u"},
223 {ecryptfs_opt_passthrough, "ecryptfs_passthrough"},
Michael Halcrow17398952007-02-12 00:53:45 -0800224 {ecryptfs_opt_xattr_metadata, "ecryptfs_xattr_metadata"},
225 {ecryptfs_opt_encrypted_view, "ecryptfs_encrypted_view"},
Michael Halcrow87c94c42009-01-06 14:42:01 -0800226 {ecryptfs_opt_fnek_sig, "ecryptfs_fnek_sig=%s"},
227 {ecryptfs_opt_fn_cipher, "ecryptfs_fn_cipher=%s"},
228 {ecryptfs_opt_fn_cipher_key_bytes, "ecryptfs_fn_key_bytes=%u"},
Tyler Hickse77cc8d2009-04-22 04:08:46 -0500229 {ecryptfs_opt_unlink_sigs, "ecryptfs_unlink_sigs"},
Michael Halcrow237fead2006-10-04 02:16:22 -0700230 {ecryptfs_opt_err, NULL}
231};
232
Michael Halcrowf4aad162007-10-16 01:27:53 -0700233static int ecryptfs_init_global_auth_toks(
234 struct ecryptfs_mount_crypt_stat *mount_crypt_stat)
Michael Halcrow237fead2006-10-04 02:16:22 -0700235{
Michael Halcrowf4aad162007-10-16 01:27:53 -0700236 struct ecryptfs_global_auth_tok *global_auth_tok;
Michael Halcrow237fead2006-10-04 02:16:22 -0700237 int rc = 0;
Michael Halcrow237fead2006-10-04 02:16:22 -0700238
Michael Halcrowf4aad162007-10-16 01:27:53 -0700239 list_for_each_entry(global_auth_tok,
240 &mount_crypt_stat->global_auth_tok_list,
241 mount_crypt_stat_list) {
Michael Halcrow5dda6992007-10-16 01:28:06 -0700242 rc = ecryptfs_keyring_auth_tok_for_sig(
243 &global_auth_tok->global_auth_tok_key,
244 &global_auth_tok->global_auth_tok,
245 global_auth_tok->sig);
246 if (rc) {
Michael Halcrowf4aad162007-10-16 01:27:53 -0700247 printk(KERN_ERR "Could not find valid key in user "
248 "session keyring for sig specified in mount "
249 "option: [%s]\n", global_auth_tok->sig);
250 global_auth_tok->flags |= ECRYPTFS_AUTH_TOK_INVALID;
Eric Sandeen982363c2008-07-23 21:30:04 -0700251 goto out;
Michael Halcrowf4aad162007-10-16 01:27:53 -0700252 } else
253 global_auth_tok->flags &= ~ECRYPTFS_AUTH_TOK_INVALID;
Michael Halcrow237fead2006-10-04 02:16:22 -0700254 }
Eric Sandeen982363c2008-07-23 21:30:04 -0700255out:
Michael Halcrow237fead2006-10-04 02:16:22 -0700256 return rc;
257}
258
Michael Halcrowf4aad162007-10-16 01:27:53 -0700259static void ecryptfs_init_mount_crypt_stat(
260 struct ecryptfs_mount_crypt_stat *mount_crypt_stat)
261{
262 memset((void *)mount_crypt_stat, 0,
263 sizeof(struct ecryptfs_mount_crypt_stat));
264 INIT_LIST_HEAD(&mount_crypt_stat->global_auth_tok_list);
265 mutex_init(&mount_crypt_stat->global_auth_tok_list_mutex);
266 mount_crypt_stat->flags |= ECRYPTFS_MOUNT_CRYPT_STAT_INITIALIZED;
267}
268
Michael Halcrow237fead2006-10-04 02:16:22 -0700269/**
270 * ecryptfs_parse_options
271 * @sb: The ecryptfs super block
272 * @options: The options pased to the kernel
273 *
274 * Parse mount options:
275 * debug=N - ecryptfs_verbosity level for debug output
276 * sig=XXX - description(signature) of the key to use
277 *
278 * Returns the dentry object of the lower-level (lower/interposed)
279 * directory; We want to mount our stackable file system on top of
280 * that lower directory.
281 *
282 * The signature of the key to use must be the description of a key
283 * already in the keyring. Mounting will fail if the key can not be
284 * found.
285 *
286 * Returns zero on success; non-zero on error
287 */
288static int ecryptfs_parse_options(struct super_block *sb, char *options)
289{
290 char *p;
291 int rc = 0;
292 int sig_set = 0;
293 int cipher_name_set = 0;
Michael Halcrow87c94c42009-01-06 14:42:01 -0800294 int fn_cipher_name_set = 0;
Michael Halcrow237fead2006-10-04 02:16:22 -0700295 int cipher_key_bytes;
296 int cipher_key_bytes_set = 0;
Michael Halcrow87c94c42009-01-06 14:42:01 -0800297 int fn_cipher_key_bytes;
298 int fn_cipher_key_bytes_set = 0;
Michael Halcrow237fead2006-10-04 02:16:22 -0700299 struct ecryptfs_mount_crypt_stat *mount_crypt_stat =
300 &ecryptfs_superblock_to_private(sb)->mount_crypt_stat;
301 substring_t args[MAX_OPT_ARGS];
302 int token;
303 char *sig_src;
Michael Halcrow237fead2006-10-04 02:16:22 -0700304 char *cipher_name_dst;
305 char *cipher_name_src;
Michael Halcrow87c94c42009-01-06 14:42:01 -0800306 char *fn_cipher_name_dst;
307 char *fn_cipher_name_src;
308 char *fnek_dst;
309 char *fnek_src;
Michael Halcrow237fead2006-10-04 02:16:22 -0700310 char *cipher_key_bytes_src;
Michael Halcrow87c94c42009-01-06 14:42:01 -0800311 char *fn_cipher_key_bytes_src;
Michael Halcrow237fead2006-10-04 02:16:22 -0700312
313 if (!options) {
314 rc = -EINVAL;
315 goto out;
316 }
Michael Halcrow956159c2007-10-16 01:27:55 -0700317 ecryptfs_init_mount_crypt_stat(mount_crypt_stat);
Michael Halcrow237fead2006-10-04 02:16:22 -0700318 while ((p = strsep(&options, ",")) != NULL) {
319 if (!*p)
320 continue;
321 token = match_token(p, tokens, args);
322 switch (token) {
323 case ecryptfs_opt_sig:
324 case ecryptfs_opt_ecryptfs_sig:
325 sig_src = args[0].from;
Michael Halcrowf4aad162007-10-16 01:27:53 -0700326 rc = ecryptfs_add_global_auth_tok(mount_crypt_stat,
Tyler Hicks84814d62009-03-13 13:51:59 -0700327 sig_src, 0);
Michael Halcrowf4aad162007-10-16 01:27:53 -0700328 if (rc) {
329 printk(KERN_ERR "Error attempting to register "
330 "global sig; rc = [%d]\n", rc);
331 goto out;
332 }
Michael Halcrow237fead2006-10-04 02:16:22 -0700333 sig_set = 1;
334 break;
Michael Halcrow237fead2006-10-04 02:16:22 -0700335 case ecryptfs_opt_cipher:
336 case ecryptfs_opt_ecryptfs_cipher:
337 cipher_name_src = args[0].from;
338 cipher_name_dst =
339 mount_crypt_stat->
340 global_default_cipher_name;
341 strncpy(cipher_name_dst, cipher_name_src,
342 ECRYPTFS_MAX_CIPHER_NAME_SIZE);
Michael Halcrow87c94c42009-01-06 14:42:01 -0800343 cipher_name_dst[ECRYPTFS_MAX_CIPHER_NAME_SIZE] = '\0';
Michael Halcrow237fead2006-10-04 02:16:22 -0700344 cipher_name_set = 1;
345 break;
346 case ecryptfs_opt_ecryptfs_key_bytes:
347 cipher_key_bytes_src = args[0].from;
348 cipher_key_bytes =
349 (int)simple_strtol(cipher_key_bytes_src,
350 &cipher_key_bytes_src, 0);
351 mount_crypt_stat->global_default_cipher_key_size =
352 cipher_key_bytes;
Michael Halcrow237fead2006-10-04 02:16:22 -0700353 cipher_key_bytes_set = 1;
354 break;
355 case ecryptfs_opt_passthrough:
356 mount_crypt_stat->flags |=
357 ECRYPTFS_PLAINTEXT_PASSTHROUGH_ENABLED;
358 break;
Michael Halcrow17398952007-02-12 00:53:45 -0800359 case ecryptfs_opt_xattr_metadata:
360 mount_crypt_stat->flags |=
361 ECRYPTFS_XATTR_METADATA_ENABLED;
362 break;
363 case ecryptfs_opt_encrypted_view:
364 mount_crypt_stat->flags |=
365 ECRYPTFS_XATTR_METADATA_ENABLED;
366 mount_crypt_stat->flags |=
367 ECRYPTFS_ENCRYPTED_VIEW_ENABLED;
368 break;
Michael Halcrow87c94c42009-01-06 14:42:01 -0800369 case ecryptfs_opt_fnek_sig:
370 fnek_src = args[0].from;
371 fnek_dst =
372 mount_crypt_stat->global_default_fnek_sig;
373 strncpy(fnek_dst, fnek_src, ECRYPTFS_SIG_SIZE_HEX);
374 mount_crypt_stat->global_default_fnek_sig[
375 ECRYPTFS_SIG_SIZE_HEX] = '\0';
376 rc = ecryptfs_add_global_auth_tok(
377 mount_crypt_stat,
Tyler Hicks84814d62009-03-13 13:51:59 -0700378 mount_crypt_stat->global_default_fnek_sig,
379 ECRYPTFS_AUTH_TOK_FNEK);
Michael Halcrow87c94c42009-01-06 14:42:01 -0800380 if (rc) {
381 printk(KERN_ERR "Error attempting to register "
382 "global fnek sig [%s]; rc = [%d]\n",
383 mount_crypt_stat->global_default_fnek_sig,
384 rc);
385 goto out;
386 }
387 mount_crypt_stat->flags |=
388 (ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES
389 | ECRYPTFS_GLOBAL_ENCFN_USE_MOUNT_FNEK);
390 break;
391 case ecryptfs_opt_fn_cipher:
392 fn_cipher_name_src = args[0].from;
393 fn_cipher_name_dst =
394 mount_crypt_stat->global_default_fn_cipher_name;
395 strncpy(fn_cipher_name_dst, fn_cipher_name_src,
396 ECRYPTFS_MAX_CIPHER_NAME_SIZE);
397 mount_crypt_stat->global_default_fn_cipher_name[
398 ECRYPTFS_MAX_CIPHER_NAME_SIZE] = '\0';
399 fn_cipher_name_set = 1;
400 break;
401 case ecryptfs_opt_fn_cipher_key_bytes:
402 fn_cipher_key_bytes_src = args[0].from;
403 fn_cipher_key_bytes =
404 (int)simple_strtol(fn_cipher_key_bytes_src,
405 &fn_cipher_key_bytes_src, 0);
406 mount_crypt_stat->global_default_fn_cipher_key_bytes =
407 fn_cipher_key_bytes;
408 fn_cipher_key_bytes_set = 1;
409 break;
Tyler Hickse77cc8d2009-04-22 04:08:46 -0500410 case ecryptfs_opt_unlink_sigs:
411 mount_crypt_stat->flags |= ECRYPTFS_UNLINK_SIGS;
412 break;
Michael Halcrow237fead2006-10-04 02:16:22 -0700413 case ecryptfs_opt_err:
414 default:
Michael Halcrow87c94c42009-01-06 14:42:01 -0800415 printk(KERN_WARNING
416 "%s: eCryptfs: unrecognized option [%s]\n",
417 __func__, p);
Michael Halcrow237fead2006-10-04 02:16:22 -0700418 }
419 }
Michael Halcrow237fead2006-10-04 02:16:22 -0700420 if (!sig_set) {
421 rc = -EINVAL;
Michael Halcrow956159c2007-10-16 01:27:55 -0700422 ecryptfs_printk(KERN_ERR, "You must supply at least one valid "
423 "auth tok signature as a mount "
Michael Halcrow237fead2006-10-04 02:16:22 -0700424 "parameter; see the eCryptfs README\n");
425 goto out;
426 }
427 if (!cipher_name_set) {
Miklos Szeredi8f236802008-07-23 21:30:05 -0700428 int cipher_name_len = strlen(ECRYPTFS_DEFAULT_CIPHER);
429
430 BUG_ON(cipher_name_len >= ECRYPTFS_MAX_CIPHER_NAME_SIZE);
Miklos Szeredi8f236802008-07-23 21:30:05 -0700431 strcpy(mount_crypt_stat->global_default_cipher_name,
432 ECRYPTFS_DEFAULT_CIPHER);
Michael Halcrow237fead2006-10-04 02:16:22 -0700433 }
Michael Halcrow87c94c42009-01-06 14:42:01 -0800434 if ((mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES)
435 && !fn_cipher_name_set)
436 strcpy(mount_crypt_stat->global_default_fn_cipher_name,
437 mount_crypt_stat->global_default_cipher_name);
438 if (!cipher_key_bytes_set)
Michael Halcrowe5d9cbd2006-10-30 22:07:16 -0800439 mount_crypt_stat->global_default_cipher_key_size = 0;
Michael Halcrow87c94c42009-01-06 14:42:01 -0800440 if ((mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES)
441 && !fn_cipher_key_bytes_set)
442 mount_crypt_stat->global_default_fn_cipher_key_bytes =
443 mount_crypt_stat->global_default_cipher_key_size;
Eric Sandeenaf440f52008-02-06 01:38:37 -0800444 mutex_lock(&key_tfm_list_mutex);
445 if (!ecryptfs_tfm_exists(mount_crypt_stat->global_default_cipher_name,
Michael Halcrow87c94c42009-01-06 14:42:01 -0800446 NULL)) {
Eric Sandeenaf440f52008-02-06 01:38:37 -0800447 rc = ecryptfs_add_new_key_tfm(
448 NULL, mount_crypt_stat->global_default_cipher_name,
449 mount_crypt_stat->global_default_cipher_key_size);
Michael Halcrow87c94c42009-01-06 14:42:01 -0800450 if (rc) {
451 printk(KERN_ERR "Error attempting to initialize "
452 "cipher with name = [%s] and key size = [%td]; "
453 "rc = [%d]\n",
454 mount_crypt_stat->global_default_cipher_name,
455 mount_crypt_stat->global_default_cipher_key_size,
456 rc);
457 rc = -EINVAL;
458 mutex_unlock(&key_tfm_list_mutex);
459 goto out;
460 }
Michael Halcrow237fead2006-10-04 02:16:22 -0700461 }
Michael Halcrow87c94c42009-01-06 14:42:01 -0800462 if ((mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES)
463 && !ecryptfs_tfm_exists(
464 mount_crypt_stat->global_default_fn_cipher_name, NULL)) {
465 rc = ecryptfs_add_new_key_tfm(
466 NULL, mount_crypt_stat->global_default_fn_cipher_name,
467 mount_crypt_stat->global_default_fn_cipher_key_bytes);
468 if (rc) {
469 printk(KERN_ERR "Error attempting to initialize "
470 "cipher with name = [%s] and key size = [%td]; "
471 "rc = [%d]\n",
472 mount_crypt_stat->global_default_fn_cipher_name,
473 mount_crypt_stat->global_default_fn_cipher_key_bytes,
474 rc);
475 rc = -EINVAL;
476 mutex_unlock(&key_tfm_list_mutex);
477 goto out;
478 }
479 }
480 mutex_unlock(&key_tfm_list_mutex);
Michael Halcrow5dda6992007-10-16 01:28:06 -0700481 rc = ecryptfs_init_global_auth_toks(mount_crypt_stat);
Michael Halcrow87c94c42009-01-06 14:42:01 -0800482 if (rc)
Michael Halcrowf4aad162007-10-16 01:27:53 -0700483 printk(KERN_WARNING "One or more global auth toks could not "
484 "properly register; rc = [%d]\n", rc);
Michael Halcrow237fead2006-10-04 02:16:22 -0700485out:
486 return rc;
487}
488
489struct kmem_cache *ecryptfs_sb_info_cache;
490
491/**
492 * ecryptfs_fill_super
493 * @sb: The ecryptfs super block
494 * @raw_data: The options passed to mount
495 * @silent: Not used but required by function prototype
496 *
497 * Sets up what we can of the sb, rest is done in ecryptfs_read_super
498 *
499 * Returns zero on success; non-zero otherwise
500 */
501static int
502ecryptfs_fill_super(struct super_block *sb, void *raw_data, int silent)
503{
504 int rc = 0;
505
506 /* Released in ecryptfs_put_super() */
507 ecryptfs_set_superblock_private(sb,
Robert P. J. Dayc3762222007-02-10 01:45:03 -0800508 kmem_cache_zalloc(ecryptfs_sb_info_cache,
Christoph Lametere94b1762006-12-06 20:33:17 -0800509 GFP_KERNEL));
Michael Halcrow237fead2006-10-04 02:16:22 -0700510 if (!ecryptfs_superblock_to_private(sb)) {
511 ecryptfs_printk(KERN_WARNING, "Out of memory\n");
512 rc = -ENOMEM;
513 goto out;
514 }
Michael Halcrow237fead2006-10-04 02:16:22 -0700515 sb->s_op = &ecryptfs_sops;
516 /* Released through deactivate_super(sb) from get_sb_nodev */
517 sb->s_root = d_alloc(NULL, &(const struct qstr) {
518 .hash = 0,.name = "/",.len = 1});
519 if (!sb->s_root) {
520 ecryptfs_printk(KERN_ERR, "d_alloc failed\n");
521 rc = -ENOMEM;
522 goto out;
523 }
524 sb->s_root->d_op = &ecryptfs_dops;
525 sb->s_root->d_sb = sb;
526 sb->s_root->d_parent = sb->s_root;
527 /* Released in d_release when dput(sb->s_root) is called */
528 /* through deactivate_super(sb) from get_sb_nodev() */
529 ecryptfs_set_dentry_private(sb->s_root,
Robert P. J. Dayc3762222007-02-10 01:45:03 -0800530 kmem_cache_zalloc(ecryptfs_dentry_info_cache,
Christoph Lametere94b1762006-12-06 20:33:17 -0800531 GFP_KERNEL));
Michael Halcrow237fead2006-10-04 02:16:22 -0700532 if (!ecryptfs_dentry_to_private(sb->s_root)) {
533 ecryptfs_printk(KERN_ERR,
534 "dentry_info_cache alloc failed\n");
535 rc = -ENOMEM;
536 goto out;
537 }
Michael Halcrow237fead2006-10-04 02:16:22 -0700538 rc = 0;
539out:
540 /* Should be able to rely on deactivate_super called from
541 * get_sb_nodev */
542 return rc;
543}
544
545/**
546 * ecryptfs_read_super
547 * @sb: The ecryptfs super block
548 * @dev_name: The path to mount over
549 *
550 * Read the super block of the lower filesystem, and use
551 * ecryptfs_interpose to create our initial inode and super block
552 * struct.
553 */
554static int ecryptfs_read_super(struct super_block *sb, const char *dev_name)
555{
Al Viro421748e2008-08-02 01:04:36 -0400556 struct path path;
Michael Halcrow237fead2006-10-04 02:16:22 -0700557 int rc;
Michael Halcrow237fead2006-10-04 02:16:22 -0700558
Al Viro421748e2008-08-02 01:04:36 -0400559 rc = kern_path(dev_name, LOOKUP_FOLLOW | LOOKUP_DIRECTORY, &path);
Michael Halcrow237fead2006-10-04 02:16:22 -0700560 if (rc) {
561 ecryptfs_printk(KERN_WARNING, "path_lookup() failed\n");
Michael Halcrow65dc8142007-02-28 20:12:57 -0800562 goto out;
Michael Halcrow237fead2006-10-04 02:16:22 -0700563 }
Al Viro421748e2008-08-02 01:04:36 -0400564 ecryptfs_set_superblock_lower(sb, path.dentry->d_sb);
565 sb->s_maxbytes = path.dentry->d_sb->s_maxbytes;
566 sb->s_blocksize = path.dentry->d_sb->s_blocksize;
567 ecryptfs_set_dentry_lower(sb->s_root, path.dentry);
568 ecryptfs_set_dentry_lower_mnt(sb->s_root, path.mnt);
569 rc = ecryptfs_interpose(path.dentry, sb->s_root, sb, 0);
Michael Halcrow5dda6992007-10-16 01:28:06 -0700570 if (rc)
Michael Halcrow237fead2006-10-04 02:16:22 -0700571 goto out_free;
572 rc = 0;
573 goto out;
574out_free:
Al Viro421748e2008-08-02 01:04:36 -0400575 path_put(&path);
Michael Halcrow237fead2006-10-04 02:16:22 -0700576out:
577 return rc;
578}
579
580/**
581 * ecryptfs_get_sb
582 * @fs_type
583 * @flags
584 * @dev_name: The path to mount over
585 * @raw_data: The options passed into the kernel
586 *
587 * The whole ecryptfs_get_sb process is broken into 4 functions:
588 * ecryptfs_parse_options(): handle options passed to ecryptfs, if any
589 * ecryptfs_fill_super(): used by get_sb_nodev, fills out the super_block
590 * with as much information as it can before needing
591 * the lower filesystem.
592 * ecryptfs_read_super(): this accesses the lower filesystem and uses
593 * ecryptfs_interpolate to perform most of the linking
594 * ecryptfs_interpolate(): links the lower filesystem into ecryptfs
595 */
596static int ecryptfs_get_sb(struct file_system_type *fs_type, int flags,
597 const char *dev_name, void *raw_data,
598 struct vfsmount *mnt)
599{
600 int rc;
601 struct super_block *sb;
602
603 rc = get_sb_nodev(fs_type, flags, raw_data, ecryptfs_fill_super, mnt);
604 if (rc < 0) {
605 printk(KERN_ERR "Getting sb failed; rc = [%d]\n", rc);
606 goto out;
607 }
608 sb = mnt->mnt_sb;
609 rc = ecryptfs_parse_options(sb, raw_data);
610 if (rc) {
611 printk(KERN_ERR "Error parsing options; rc = [%d]\n", rc);
612 goto out_abort;
613 }
614 rc = ecryptfs_read_super(sb, dev_name);
615 if (rc) {
616 printk(KERN_ERR "Reading sb failed; rc = [%d]\n", rc);
617 goto out_abort;
618 }
619 goto out;
620out_abort:
Al Viro6f5bbff2009-05-06 01:34:22 -0400621 dput(sb->s_root); /* aka mnt->mnt_root, as set by get_sb_nodev() */
622 deactivate_locked_super(sb);
Michael Halcrow237fead2006-10-04 02:16:22 -0700623out:
624 return rc;
625}
626
627/**
628 * ecryptfs_kill_block_super
629 * @sb: The ecryptfs super block
630 *
631 * Used to bring the superblock down and free the private data.
632 * Private data is free'd in ecryptfs_put_super()
633 */
634static void ecryptfs_kill_block_super(struct super_block *sb)
635{
636 generic_shutdown_super(sb);
637}
638
639static struct file_system_type ecryptfs_fs_type = {
640 .owner = THIS_MODULE,
641 .name = "ecryptfs",
642 .get_sb = ecryptfs_get_sb,
643 .kill_sb = ecryptfs_kill_block_super,
644 .fs_flags = 0
645};
646
647/**
648 * inode_info_init_once
649 *
650 * Initializes the ecryptfs_inode_info_cache when it is created
651 */
652static void
Alexey Dobriyan51cc5062008-07-25 19:45:34 -0700653inode_info_init_once(void *vptr)
Michael Halcrow237fead2006-10-04 02:16:22 -0700654{
655 struct ecryptfs_inode_info *ei = (struct ecryptfs_inode_info *)vptr;
656
Christoph Lametera35afb82007-05-16 22:10:57 -0700657 inode_init_once(&ei->vfs_inode);
Michael Halcrow237fead2006-10-04 02:16:22 -0700658}
659
660static struct ecryptfs_cache_info {
Christoph Lametere18b8902006-12-06 20:33:20 -0800661 struct kmem_cache **cache;
Michael Halcrow237fead2006-10-04 02:16:22 -0700662 const char *name;
663 size_t size;
Alexey Dobriyan51cc5062008-07-25 19:45:34 -0700664 void (*ctor)(void *obj);
Michael Halcrow237fead2006-10-04 02:16:22 -0700665} ecryptfs_cache_infos[] = {
666 {
667 .cache = &ecryptfs_auth_tok_list_item_cache,
668 .name = "ecryptfs_auth_tok_list_item",
669 .size = sizeof(struct ecryptfs_auth_tok_list_item),
670 },
671 {
672 .cache = &ecryptfs_file_info_cache,
673 .name = "ecryptfs_file_cache",
674 .size = sizeof(struct ecryptfs_file_info),
675 },
676 {
677 .cache = &ecryptfs_dentry_info_cache,
678 .name = "ecryptfs_dentry_info_cache",
679 .size = sizeof(struct ecryptfs_dentry_info),
680 },
681 {
682 .cache = &ecryptfs_inode_info_cache,
683 .name = "ecryptfs_inode_cache",
684 .size = sizeof(struct ecryptfs_inode_info),
685 .ctor = inode_info_init_once,
686 },
687 {
688 .cache = &ecryptfs_sb_info_cache,
689 .name = "ecryptfs_sb_cache",
690 .size = sizeof(struct ecryptfs_sb_info),
691 },
692 {
Michael Halcrow237fead2006-10-04 02:16:22 -0700693 .cache = &ecryptfs_header_cache_1,
694 .name = "ecryptfs_headers_1",
695 .size = PAGE_CACHE_SIZE,
696 },
697 {
698 .cache = &ecryptfs_header_cache_2,
699 .name = "ecryptfs_headers_2",
700 .size = PAGE_CACHE_SIZE,
701 },
702 {
Michael Halcrowdd2a3b72007-02-12 00:53:46 -0800703 .cache = &ecryptfs_xattr_cache,
704 .name = "ecryptfs_xattr_cache",
705 .size = PAGE_CACHE_SIZE,
706 },
707 {
Michael Halcroweb95e7f2007-02-16 01:28:40 -0800708 .cache = &ecryptfs_key_record_cache,
709 .name = "ecryptfs_key_record_cache",
710 .size = sizeof(struct ecryptfs_key_record),
711 },
Michael Halcrow956159c2007-10-16 01:27:55 -0700712 {
713 .cache = &ecryptfs_key_sig_cache,
714 .name = "ecryptfs_key_sig_cache",
715 .size = sizeof(struct ecryptfs_key_sig),
716 },
717 {
718 .cache = &ecryptfs_global_auth_tok_cache,
719 .name = "ecryptfs_global_auth_tok_cache",
720 .size = sizeof(struct ecryptfs_global_auth_tok),
721 },
722 {
723 .cache = &ecryptfs_key_tfm_cache,
724 .name = "ecryptfs_key_tfm_cache",
725 .size = sizeof(struct ecryptfs_key_tfm),
726 },
Michael Halcrow746f1e52008-07-23 21:30:02 -0700727 {
728 .cache = &ecryptfs_open_req_cache,
729 .name = "ecryptfs_open_req_cache",
730 .size = sizeof(struct ecryptfs_open_req),
731 },
Michael Halcrow237fead2006-10-04 02:16:22 -0700732};
733
734static void ecryptfs_free_kmem_caches(void)
735{
736 int i;
737
738 for (i = 0; i < ARRAY_SIZE(ecryptfs_cache_infos); i++) {
739 struct ecryptfs_cache_info *info;
740
741 info = &ecryptfs_cache_infos[i];
742 if (*(info->cache))
743 kmem_cache_destroy(*(info->cache));
744 }
745}
746
747/**
748 * ecryptfs_init_kmem_caches
749 *
750 * Returns zero on success; non-zero otherwise
751 */
752static int ecryptfs_init_kmem_caches(void)
753{
754 int i;
755
756 for (i = 0; i < ARRAY_SIZE(ecryptfs_cache_infos); i++) {
757 struct ecryptfs_cache_info *info;
758
759 info = &ecryptfs_cache_infos[i];
760 *(info->cache) = kmem_cache_create(info->name, info->size,
Paul Mundt20c2df82007-07-20 10:11:58 +0900761 0, SLAB_HWCACHE_ALIGN, info->ctor);
Michael Halcrow237fead2006-10-04 02:16:22 -0700762 if (!*(info->cache)) {
763 ecryptfs_free_kmem_caches();
764 ecryptfs_printk(KERN_WARNING, "%s: "
765 "kmem_cache_create failed\n",
766 info->name);
767 return -ENOMEM;
768 }
769 }
770 return 0;
771}
772
Greg Kroah-Hartman6e90aa92007-11-06 15:08:08 -0800773static struct kobject *ecryptfs_kobj;
Michael Halcrow237fead2006-10-04 02:16:22 -0700774
Kay Sievers386f2752007-11-02 13:47:53 +0100775static ssize_t version_show(struct kobject *kobj,
776 struct kobj_attribute *attr, char *buff)
Michael Halcrow237fead2006-10-04 02:16:22 -0700777{
778 return snprintf(buff, PAGE_SIZE, "%d\n", ECRYPTFS_VERSIONING_MASK);
779}
780
Kay Sievers386f2752007-11-02 13:47:53 +0100781static struct kobj_attribute version_attr = __ATTR_RO(version);
Michael Halcrow237fead2006-10-04 02:16:22 -0700782
Greg Kroah-Hartman30a468b2007-10-15 15:01:24 -0700783static struct attribute *attributes[] = {
784 &version_attr.attr,
Greg Kroah-Hartman30a468b2007-10-15 15:01:24 -0700785 NULL,
786};
787
788static struct attribute_group attr_group = {
789 .attrs = attributes,
790};
Michael Halcrow237fead2006-10-04 02:16:22 -0700791
792static int do_sysfs_registration(void)
793{
794 int rc;
795
Greg Kroah-Hartman6e90aa92007-11-06 15:08:08 -0800796 ecryptfs_kobj = kobject_create_and_add("ecryptfs", fs_kobj);
797 if (!ecryptfs_kobj) {
Greg Kroah-Hartman917e8652007-10-29 20:13:17 +0100798 printk(KERN_ERR "Unable to create ecryptfs kset\n");
799 rc = -ENOMEM;
Michael Halcrow237fead2006-10-04 02:16:22 -0700800 goto out;
801 }
Greg Kroah-Hartman6e90aa92007-11-06 15:08:08 -0800802 rc = sysfs_create_group(ecryptfs_kobj, &attr_group);
Michael Halcrow237fead2006-10-04 02:16:22 -0700803 if (rc) {
804 printk(KERN_ERR
Greg Kroah-Hartman30a468b2007-10-15 15:01:24 -0700805 "Unable to create ecryptfs version attributes\n");
Greg Kroah-Hartman197b12d2007-12-20 08:13:05 -0800806 kobject_put(ecryptfs_kobj);
Michael Halcrow237fead2006-10-04 02:16:22 -0700807 }
808out:
809 return rc;
810}
811
Ryusuke Konishia75de1b2007-08-10 13:00:56 -0700812static void do_sysfs_unregistration(void)
813{
Greg Kroah-Hartman6e90aa92007-11-06 15:08:08 -0800814 sysfs_remove_group(ecryptfs_kobj, &attr_group);
Greg Kroah-Hartman197b12d2007-12-20 08:13:05 -0800815 kobject_put(ecryptfs_kobj);
Ryusuke Konishia75de1b2007-08-10 13:00:56 -0700816}
817
Michael Halcrow237fead2006-10-04 02:16:22 -0700818static int __init ecryptfs_init(void)
819{
820 int rc;
821
822 if (ECRYPTFS_DEFAULT_EXTENT_SIZE > PAGE_CACHE_SIZE) {
823 rc = -EINVAL;
824 ecryptfs_printk(KERN_ERR, "The eCryptfs extent size is "
825 "larger than the host's page size, and so "
826 "eCryptfs cannot run on this system. The "
827 "default eCryptfs extent size is [%d] bytes; "
828 "the page size is [%d] bytes.\n",
829 ECRYPTFS_DEFAULT_EXTENT_SIZE, PAGE_CACHE_SIZE);
830 goto out;
831 }
832 rc = ecryptfs_init_kmem_caches();
833 if (rc) {
834 printk(KERN_ERR
835 "Failed to allocate one or more kmem_cache objects\n");
836 goto out;
837 }
838 rc = register_filesystem(&ecryptfs_fs_type);
839 if (rc) {
840 printk(KERN_ERR "Failed to register filesystem\n");
Michael Halcrowcf81f892007-10-16 01:28:07 -0700841 goto out_free_kmem_caches;
Michael Halcrow237fead2006-10-04 02:16:22 -0700842 }
Michael Halcrow237fead2006-10-04 02:16:22 -0700843 rc = do_sysfs_registration();
844 if (rc) {
845 printk(KERN_ERR "sysfs registration failed\n");
Michael Halcrowcf81f892007-10-16 01:28:07 -0700846 goto out_unregister_filesystem;
Michael Halcrow237fead2006-10-04 02:16:22 -0700847 }
Michael Halcrow746f1e52008-07-23 21:30:02 -0700848 rc = ecryptfs_init_kthread();
849 if (rc) {
850 printk(KERN_ERR "%s: kthread initialization failed; "
851 "rc = [%d]\n", __func__, rc);
852 goto out_do_sysfs_unregistration;
853 }
Tyler Hicks624ae522008-10-15 22:02:51 -0700854 rc = ecryptfs_init_messaging();
Michael Halcrowdddfa462007-02-12 00:53:44 -0800855 if (rc) {
Michael Halcrow746f1e52008-07-23 21:30:02 -0700856 printk(KERN_ERR "Failure occured while attempting to "
Tyler Hicks624ae522008-10-15 22:02:51 -0700857 "initialize the communications channel to "
858 "ecryptfsd\n");
Michael Halcrow746f1e52008-07-23 21:30:02 -0700859 goto out_destroy_kthread;
Michael Halcrow956159c2007-10-16 01:27:55 -0700860 }
861 rc = ecryptfs_init_crypto();
862 if (rc) {
863 printk(KERN_ERR "Failure whilst attempting to init crypto; "
864 "rc = [%d]\n", rc);
Michael Halcrowcf81f892007-10-16 01:28:07 -0700865 goto out_release_messaging;
Michael Halcrowdddfa462007-02-12 00:53:44 -0800866 }
Eric Sandeen2830bfd2008-02-06 01:38:34 -0800867 if (ecryptfs_verbosity > 0)
868 printk(KERN_CRIT "eCryptfs verbosity set to %d. Secret values "
869 "will be written to the syslog!\n", ecryptfs_verbosity);
870
Michael Halcrowcf81f892007-10-16 01:28:07 -0700871 goto out;
872out_release_messaging:
Tyler Hicks624ae522008-10-15 22:02:51 -0700873 ecryptfs_release_messaging();
Michael Halcrow746f1e52008-07-23 21:30:02 -0700874out_destroy_kthread:
875 ecryptfs_destroy_kthread();
Michael Halcrowcf81f892007-10-16 01:28:07 -0700876out_do_sysfs_unregistration:
877 do_sysfs_unregistration();
878out_unregister_filesystem:
879 unregister_filesystem(&ecryptfs_fs_type);
880out_free_kmem_caches:
881 ecryptfs_free_kmem_caches();
Michael Halcrow237fead2006-10-04 02:16:22 -0700882out:
883 return rc;
884}
885
886static void __exit ecryptfs_exit(void)
887{
Michael Halcrowcf81f892007-10-16 01:28:07 -0700888 int rc;
889
890 rc = ecryptfs_destroy_crypto();
891 if (rc)
892 printk(KERN_ERR "Failure whilst attempting to destroy crypto; "
893 "rc = [%d]\n", rc);
Tyler Hicks624ae522008-10-15 22:02:51 -0700894 ecryptfs_release_messaging();
Michael Halcrow746f1e52008-07-23 21:30:02 -0700895 ecryptfs_destroy_kthread();
Michael Halcrowcf81f892007-10-16 01:28:07 -0700896 do_sysfs_unregistration();
Michael Halcrow237fead2006-10-04 02:16:22 -0700897 unregister_filesystem(&ecryptfs_fs_type);
898 ecryptfs_free_kmem_caches();
899}
900
901MODULE_AUTHOR("Michael A. Halcrow <mhalcrow@us.ibm.com>");
902MODULE_DESCRIPTION("eCryptfs");
903
904MODULE_LICENSE("GPL");
905
906module_init(ecryptfs_init)
907module_exit(ecryptfs_exit)