Bug 43195

Summary: [Regression] 'Credentials' mount option not recognized
Product: File System Reporter: Ronald (ronald645)
Component: CIFSAssignee: Jeff Layton (jlayton)
Status: RESOLVED CODE_FIX    
Severity: normal CC: florian, jlayton
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 3.4.0-rc4-wl+ Subsystem:
Regression: Yes Bisected commit-id:

Description Ronald 2012-05-02 17:37:34 UTC
CIFS maintainers,

During your development, a regression sneaked into the cifs module. This tree is exactly like the vanilla kernel, version 3.4-rc4, except for an additional:

git pull git://anongit.freedesktop.org/nouveau/linux-2.6
git pull git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git (hence the -wl suffix)

The testcase:

Kernel version v3.3.2:
Charlie ~ # rm /tmp/test
Charlie ~ # touch /tmp/test
Charlie ~ # mount //10.1.9.251/gedeeld /media -o credentials=/tmp/test
Password: 
Charlie ~ #

Success

Kernel version v3.4-rc4-wl+:
Charlie ~ # rm /tmp/test
Charlie ~ # touch /tmp/test
Charlie ~ # mount //10.1.9.251/gedeeld /media -o credentials=/tmp/test
Password: 
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Charlie ~ # dmesg | tail -n1
[  440.046450] CIFS: Unknown mount option "credentials=/tmp/test"

Fail

Even if I insert data into the credentials file, I get the same error.

Git log fs/cifs shows a substantial amount of rework for handling mount options. If a bisect is appreciated, please let me know.

                           Ronald
Comment 1 Jeff Layton 2012-05-02 18:06:01 UTC
Thanks for the bug report. I've just sent a patch that fixes this in my testing
so I've gone ahead and mailed it to the maintainer. Please reopen this bug if
you find anything amiss with it:

    http://article.gmane.org/gmane.linux.kernel.cifs/6060

I'll also plan to patch mount.cifs so that it doesn't pass the credentials=
option to the kernel, but we'll still need to deal with older mount.cifs
programs so we'll need a kernel patch for this regardless.
Comment 2 Florian Mickler 2012-05-07 19:05:15 UTC
A patch referencing this bug report has been merged in Linux v3.4-rc6:

commit a557b97616c49d81e09c8439831d4c4f13ef4050
Author: Jeff Layton <jlayton@redhat.com>
Date:   Wed May 2 14:02:40 2012 -0400

    cifs: make sure we ignore the credentials= and cred= options