[Bug 212861] [tmpfs] uchg files can be removed by root

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Tue Sep 20 17:48:48 UTC 2016


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=212861

            Bug ID: 212861
           Summary: [tmpfs] uchg files can be removed by root
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs at FreeBSD.org
          Reporter: ngie at FreeBSD.org

This issue seems to be present on tmpfs, only (it always returns EPERM on UFS).
Not sure about ZFS.

Found by contrib/netbsd-tests/fs/tmpfs/t_remove.sh .

The following command snippets demonstrate the repro:

Invariant tested with UFS:

$ touch /tmp/uchg.file
$ chflags uchg /tmp/uchg.file
$ rm -f /tmp/uchg.file
rm: /tmp/uchg.file: Operation not permitted
$ rm /tmp/uchg.file 
override rw-r--r--  ngie/wheel uchg for /tmp/uchg.file? y
rm: /tmp/uchg.file: Operation not permitted
$

Invariant tested with tmpfs:

$ mntpt=/tmp/tmpfs
$ mkdir $mntpt
$ sudo mount -t tmpfs tmpfs $mntpt
$ cd $mntpt
$ touch uchg.file; chflags uchg uchg.file
$ rm -f uchg.file 
rm: uchg.file: Operation not permitted
$ sudo rm -f uchg.file 
$ ls uchg.file 
ls: uchg.file: No such file or directory
$

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list