Skip to content

Commit 2830bfd

Browse files
Eric SandeenLinus Torvalds
authored andcommitted
ecryptfs: remove debug as mount option, and warn if set via modprobe
ecryptfs_debug really should not be a mount option; it is not per-mount, but rather sets a global "ecryptfs_verbosity" variable which affects all mounted filesysytems. It's already settable as a module load option, I think we can leave it at that. Also, if set, since secret values come out in debug messages, kick things off with a stern warning. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Acked-by: Mike Halcrow <mhalcrow@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 99db6e4 commit 2830bfd

2 files changed

Lines changed: 7 additions & 20 deletions

File tree

‎fs/ecryptfs/main.c‎

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -226,17 +226,15 @@ int ecryptfs_interpose(struct dentry *lower_dentry, struct dentry *dentry,
226226
return rc;
227227
}
228228

229-
enum { ecryptfs_opt_sig, ecryptfs_opt_ecryptfs_sig, ecryptfs_opt_debug,
230-
ecryptfs_opt_ecryptfs_debug, ecryptfs_opt_cipher,
231-
ecryptfs_opt_ecryptfs_cipher, ecryptfs_opt_ecryptfs_key_bytes,
229+
enum { ecryptfs_opt_sig, ecryptfs_opt_ecryptfs_sig,
230+
ecryptfs_opt_cipher, ecryptfs_opt_ecryptfs_cipher,
231+
ecryptfs_opt_ecryptfs_key_bytes,
232232
ecryptfs_opt_passthrough, ecryptfs_opt_xattr_metadata,
233233
ecryptfs_opt_encrypted_view, ecryptfs_opt_err };
234234

235235
static match_table_t tokens = {
236236
{ecryptfs_opt_sig, "sig=%s"},
237237
{ecryptfs_opt_ecryptfs_sig, "ecryptfs_sig=%s"},
238-
{ecryptfs_opt_debug, "debug=%u"},
239-
{ecryptfs_opt_ecryptfs_debug, "ecryptfs_debug=%u"},
240238
{ecryptfs_opt_cipher, "cipher=%s"},
241239
{ecryptfs_opt_ecryptfs_cipher, "ecryptfs_cipher=%s"},
242240
{ecryptfs_opt_ecryptfs_key_bytes, "ecryptfs_key_bytes=%u"},
@@ -313,7 +311,6 @@ static int ecryptfs_parse_options(struct super_block *sb, char *options)
313311
substring_t args[MAX_OPT_ARGS];
314312
int token;
315313
char *sig_src;
316-
char *debug_src;
317314
char *cipher_name_dst;
318315
char *cipher_name_src;
319316
char *cipher_key_bytes_src;
@@ -341,16 +338,6 @@ static int ecryptfs_parse_options(struct super_block *sb, char *options)
341338
}
342339
sig_set = 1;
343340
break;
344-
case ecryptfs_opt_debug:
345-
case ecryptfs_opt_ecryptfs_debug:
346-
debug_src = args[0].from;
347-
ecryptfs_verbosity =
348-
(int)simple_strtol(debug_src, &debug_src,
349-
0);
350-
ecryptfs_printk(KERN_DEBUG,
351-
"Verbosity set to [%d]" "\n",
352-
ecryptfs_verbosity);
353-
break;
354341
case ecryptfs_opt_cipher:
355342
case ecryptfs_opt_ecryptfs_cipher:
356343
cipher_name_src = args[0].from;
@@ -816,6 +803,10 @@ static int __init ecryptfs_init(void)
816803
"rc = [%d]\n", rc);
817804
goto out_release_messaging;
818805
}
806+
if (ecryptfs_verbosity > 0)
807+
printk(KERN_CRIT "eCryptfs verbosity set to %d. Secret values "
808+
"will be written to the syslog!\n", ecryptfs_verbosity);
809+
819810
goto out;
820811
out_release_messaging:
821812
ecryptfs_release_messaging(ecryptfs_transport);

‎fs/ecryptfs/super.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,6 @@ static int ecryptfs_show_options(struct seq_file *m, struct vfsmount *mnt)
174174
}
175175
mutex_unlock(&mount_crypt_stat->global_auth_tok_list_mutex);
176176

177-
/* Note this is global and probably shouldn't be a mount option */
178-
if (ecryptfs_verbosity)
179-
seq_printf(m, ",ecryptfs_debug=%d\n", ecryptfs_verbosity);
180-
181177
seq_printf(m, ",ecryptfs_cipher=%s",
182178
mount_crypt_stat->global_default_cipher_name);
183179

0 commit comments

Comments
 (0)