]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: make root id query unprivileged
authorDavid Sterba <dsterba@suse.cz>
Tue, 12 May 2015 17:14:49 +0000 (19:14 +0200)
committerChris Mason <clm@fb.com>
Wed, 3 Jun 2015 02:34:36 +0000 (19:34 -0700)
commit8155f376b66750a92fc02eba45ba5e7bf4dcac10
tree4a3f395eb64f6ab98f26b9c918cee0c1af6a8264
parent756fbded5ed6b98322cac8e98d42bc7beb481c8e
btrfs: make root id query unprivileged

The INO_LOOKUP ioctl can lookup path for a given inode number and is
thus restricted. As a sideefect it can find the root id of the
containing subvolume and we're using this int the 'btrfs inspect rootid'
command.

The restriction is unnecessary in case we set the ioctl args
 args::treeid    = 0
 args::objectid  = 256 (BTRFS_FIRST_FREE_OBJECTID)

Then the path will be empty and the treeid is filled with the root id of
the inode on which the ioctl is called. This behaviour is unchanged,
after the root restriction is removed.

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/ioctl.c