cifs: make sure we ignore the credentials= and cred= options
Subsystems (2)
PATCH 1/1 cifs: make sure we ignore the credentials= and cred= options
Older mount.cifs programs passed this on to the kernel after parsing the file. Make sure the kernel ignores that option.
Should fix:
https://bugzilla.kernel.org/show_bug.cgi?id=43195
--- fs/cifs/connect.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
fs/cifs/connect.c +2 -0
@@ -215,6 +215,8 @@ static const match_table_t cifs_mount_option_tokens = { { Opt_ignore, "cred" }, { Opt_ignore, "credentials" }, + { Opt_ignore, "cred=%s" }, + { Opt_ignore, "credentials=%s" }, { Opt_ignore, "guest" }, { Opt_ignore, "rw" }, { Opt_ignore, "ro" },
Signature · 1 line
1.7.7.6
A message that is not in the archive (sent off-list or not yet received): 1335981808-3885-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Quoted 19 lines · Jeff Layton
Older mount.cifs programs passed this on to the kernel after parsing the file. Make sure the kernel ignores that option.
Should fix:
https://bugzilla.kernel.org/show_bug.cgi?id=43195Cc Sachin Prabhu <[email protected]>Reported-by Ronald <[email protected]>Signed-off-by Jeff Layton <[email protected]>--- fs/cifs/connect.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)fs/cifs/connect.c +0
-0
fs/cifs/connect.c static const match_table_t cifs_mount_option_tokens = { · line 219
Quoted 5 lines
fs/cifs/connect.c +2
-0@@ -215,6 +215,8 @@ static const match_table_t cifs_mount_option_tokens = { { Opt_ignore, "cred" }, { Opt_ignore, "credentials" }, + { Opt_ignore, "cred=%s" }, + { Opt_ignore, "credentials=%s" },
We don't expect cred/credentials by themselves in the mount options list. Instead of adding the new checks, we can instead simply replace the original lines with ones containing the string.
- { Opt_ignore, "cred" },
- { Opt_ignore, "credentials" },
+ { Opt_ignore, "cred=%s" },
+ { Opt_ignore, "credentials=%s" },Sachin Prabhu
Quoted 35 lines · On Thu, 03 May 2012 12:18:48 +0100 Sachin Prabhu…
Quoted 19 lines · Jeff Layton
Older mount.cifs programs passed this on to the kernel after parsing the file. Make sure the kernel ignores that option.
Should fix:
https://bugzilla.kernel.org/show_bug.cgi?id=43195Cc Sachin Prabhu <[email protected]>Reported-by Ronald <[email protected]>Signed-off-by Jeff Layton <[email protected]>--- fs/cifs/connect.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)fs/cifs/connect.c +0
-0fs/cifs/connect.c static const match_table_t cifs_mount_option_tokens = { · line 219
Quoted 5 lines
fs/cifs/connect.c +2
-0@@ -215,6 +215,8 @@ static const match_table_t cifs_mount_option_tokens = { { Opt_ignore, "cred" }, { Opt_ignore, "credentials" }, + { Opt_ignore, "cred=%s" }, + { Opt_ignore, "credentials=%s" },We don't expect cred/credentials by themselves in the mount options list. Instead of adding the new checks, we can instead simply replace the original lines with ones containing the string.
fs/cifs/connect.c +2
-2- { Opt_ignore, "cred" }, - { Opt_ignore, "credentials" }, + { Opt_ignore, "cred=%s" }, + { Opt_ignore, "credentials=%s" },
Quoted 2 lines
Sachin Prabhu
I considered that, but figured we might want to keep ignoring the "bare" options. OTOH, nothing should be sending those to the kernel, so might as well remove them.
Steve has already merged my patch though, so you'd need to do a new one on top of that...
Signature · 1 line
Jeff Layton <[email protected]>