Bug 53221
Summary: | mounting path below symlink in cifs drive causes BUG | ||
---|---|---|---|
Product: | File System | Reporter: | Kjell Braden (afflux) |
Component: | CIFS | Assignee: | fs_cifs (fs_cifs) |
Status: | CLOSED CODE_FIX | ||
Severity: | normal | CC: | alan, florian, jlayton |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 3.0.0 - 3.8 | Subsystem: | |
Regression: | Yes | Bisected commit-id: | |
Attachments: |
dmesg w/ call trace
patch -- ensure that cifs_get_root only traverses directories cifsFYI from working mount with old kernels (using a relative link) cifsFYI from crashing mount with new kernels (using a relative link) |
Created attachment 92231 [details]
patch -- ensure that cifs_get_root only traverses directories
Thanks for the bug report. This patch fixes it for me, does it also fix it for you?
I should mention too that this fixes the oops, but will give you an ENOTDIR error when you try to traverse a symlink like this. I think that's probably the safest course of action here since chasing symlinks is pretty complex and is possibly racy. The patch indeed fixes the BUG, but I'd argue that throwing an error is not a great solution considering the functionality was available before. So out of curiousity... What if the symlink is an absolute one and points outside the share? For instance: /srv/symtest/link -> /root ...what happened at that point with the older kernels? On older kernels, mounting anything below an absolute link pointing outside the share (whether the mounting user is allowed to read it or not) indeed gives ENOTDIR. But with /srv/symtest/abslink -> /srv/symtest/dir mounting //localhost/symtest/abslink/subdir works. Created attachment 92241 [details]
cifsFYI from working mount with old kernels (using a relative link)
Created attachment 92251 [details]
cifsFYI from crashing mount with new kernels (using a relative link)
Posted the patch upstream since that should at least fix the oops. Feel free to weigh in with your use case that involves mounting through symlinks, and maybe someone will fix that case at some point. A patch referencing this bug report has been merged in Linux v3.9-rc1: commit ce2ac52105aa663056dfc17966ebed1bf93e6e64 Author: Jeff Layton <jlayton@redhat.com> Date: Fri Feb 1 15:11:01 2013 -0500 cifs: ensure that cifs_get_root() only traverses directories |
Created attachment 92221 [details] dmesg w/ call trace Consider the following tree: /srv/symtest /srv/symtest/dir /srv/symtest/dir/subdir /srv/symtest/link -> dir this works: # mount.cifs //smbsrv/symtest/dir/subdir/ /mnt/ this causes oops: # mount.cifs //smbsrv/symtest/link/subdir/ /mnt/ This issue was introduced in commit fec11dd9a0109fe52fd631e5c510778d6cbff6cc.