Mounting a filesystem as user fails in case of a symlink in the mount point path in fstab

Solution In Progress - Updated -

Environment

  • Red Hat Enterprise Linux 6.4

Issue

  • If a symbolic link is used in the mount point path in /etc/fstab, mount attempts to that mount point performed as user fail.

Resolution

  • The issue has been resolved in the following advisory:

util-linux-ng bug fix update

Root Cause

  • In order to fix a security issue, mount uses user's UID to evaluate paths from the command line. Then the new canonical path is used for all future operations. However, part of the mount code did not expect canonical paths when there was a symlink used in /etc/fstab.

Diagnostic Steps

Steps to reproduce:

# useradd test
# cd /var/tmp/
# mkdir test
# ln -s test test2
# echo "tmpfs /var/tmp/test2 tmpfs noauto,user,mode=755,uid=test,gid=test 0 0" >> /etc/fstab
# su - test -c 'mount /var/tmp/test2'
mount: can't find /var/tmp/test2 in /etc/fstab or /etc/mtab
# 

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.