git: sys/vfs/hammer: Don't let ioctl(HAMMERIOC_SET_PSEUDOFS) create PFS in PFS

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Sun Dec 13 06:09:07 PST 2015


commit 283f6970e848724e9bd2c20d5311e412dea5e67c
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Sun Dec 13 19:49:30 2015 +0900

    sys/vfs/hammer: Don't let ioctl(HAMMERIOC_SET_PSEUDOFS) create PFS in PFS
    
    hammer pfs-master|slave have been preventing users from creating
    a PFS in non-root PFS, but since kernel HAMMER code also assumes
    the parent inode of (non-root)PFS root inode has 0 for ip localization,
    ioctl(HAMMERIOC_SET_PSEUDOFS) itself should avoid that too.
    
    This commit doesn't affect HAMMER userspace commands because
    hammer pfs-master|slave prevent creating a PFS in PFS prior to
    calling ioctl(HAMMERIOC_SET_PSEUDOFS). It just makes better sense
    to have this check in kernel space as well since one could write
    its own userspace program that directly calls ioctl without using
    hammer userspace code.
    
    Also see 5b4785a6.

Summary of changes:
 sys/vfs/hammer/hammer_pfs.c | 9 +++++++++
 1 file changed, 9 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/283f6970e848724e9bd2c20d5311e412dea5e67c


-- 
DragonFly BSD source repository



More information about the Commits mailing list