Bug 490887 - CIFS: kernel panic if mounting a symlink
CIFS: kernel panic if mounting a symlink
Status: CLOSED DUPLICATE of bug 465143
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
5.3
All Linux
low Severity medium
: rc
: ---
Assigned To: Jeff Layton
Red Hat Kernel QE team
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-18 09:04 EDT by Konstantin Khorenko
Modified: 2014-06-18 03:38 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-04-22 14:57:35 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Konstantin Khorenko 2009-03-18 09:04:13 EDT
OpenVZ linux kernel team has found that mounting CIFS subdirectory (allowed by POSIX extensions enabled by default) which is a symlink on the CIFS server leads to the kernel panic.

2.6.18-128.1.1

How reproducible:
* assume server HOSTNAME shares the directory A via CIFS
* assume A has a symlink S inside
* following commands will crash the client node:
  # mount -t cifs //HOSTNAME/A/S /mnt
  # cd /mnt

1) This crash can be avoided by disabling POSIX extensions before mounting:
  # modprobe cifs
  # echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled

2) Another workaround:
   CIFS POSIX extensions can be disabled for single mount by undocumnted option "nounix":
  # mount -t cifs //HOSTNAME/A/S /mnt -o nounix

3) The long-term workaround might be in disabling by default POSIX extensions in kernel:
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 4c1c4f3..0005d16 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -63,7 +63,7 @@ int cifsERROR = 1;
 int traceSMB = 0;
 unsigned int oplockEnabled = 1;
 unsigned int experimEnabled = 0;
-unsigned int linuxExtEnabled = 1;
+unsigned int linuxExtEnabled = 0;
 unsigned int lookupCacheEnabled = 1;
 unsigned int multiuser_mount = 0;
 unsigned int extended_security = CIFSSEC_DEF;

Hope this helps.
Comment 1 Jeff Layton 2009-03-19 13:38:24 EDT
This seems to be fixed in the latest series of patches that I have queued up for RHEL5. The latest patchset makes the kernel return an error when you try to mount a symlink like this (-EINVAL, I think). Most likely, it got fixed when some other problems with directly mounting DFS referrals got fixed.

If you have someplace you can do so, could you confirm whether you're still able to reproduce this with the test kernels I have here:

    http://people.redhat.com/jlayton/
Comment 2 Konstantin Khorenko 2009-03-20 13:13:49 EDT
Confirm, this issue is fixed in 2.6.18-135.el5.jtltest.69 kernel.

# uname -a
Linux hostname 2.6.18-135.el5.jtltest.69 #1 SMP Wed Mar 18 11:25:06 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

# mount -t cifs //host/dir/symlink /mnt
Password:
mount error 22 = Invalid argument
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
#

Thank you, hope this will be included into release kernel soon.
Comment 5 Jeff Layton 2009-04-22 14:57:35 EDT

*** This bug has been marked as a duplicate of bug 465143 ***

Note You need to log in before you can comment on or make changes to this bug.