alistair23-linux/fs/btrfs
Ernesto A. Fernández d7d8249665 btrfs: preserve i_mode if __btrfs_set_acl() fails
When changing a file's acl mask, btrfs_set_acl() will first set the
group bits of i_mode to the value of the mask, and only then set the
actual extended attribute representing the new acl.

If the second part fails (due to lack of space, for example) and the
file had no acl attribute to begin with, the system will from now on
assume that the mask permission bits are actual group permission bits,
potentially granting access to the wrong users.

Prevent this by restoring the original mode bits if __btrfs_set_acl
fails.

Signed-off-by: Ernesto A. Fernández <ernesto.mnd.fernandez@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
2017-08-21 17:47:42 +02:00
..
tests btrfs: remove unused sectorsize member 2017-08-16 14:19:53 +02:00
acl.c btrfs: preserve i_mode if __btrfs_set_acl() fails 2017-08-21 17:47:42 +02:00
async-thread.c btrfs: constify tracepoint arguments 2017-08-16 14:19:53 +02:00
async-thread.h btrfs: constify tracepoint arguments 2017-08-16 14:19:53 +02:00
backref.c btrfs: clean up extraneous computations in add_delayed_refs 2017-08-16 16:12:01 +02:00
backref.h btrfs: backref, add tracepoints for prelim_ref insertion and merging 2017-08-16 16:12:01 +02:00
btrfs_inode.h btrfs: separate defrag and property compression 2017-08-16 16:12:05 +02:00
check-integrity.c btrfs: use appropriate define for the fsid 2017-08-18 16:36:29 +02:00
check-integrity.h
compression.c Btrfs: add skeleton code for compression heuristic 2017-08-16 16:12:04 +02:00
compression.h btrfs: remove unused BTRFS_COMPRESS_LAST 2017-08-18 16:36:29 +02:00
ctree.c btrfs: get fs_info from eb in btrfs_print_leaf, remove argument 2017-08-16 16:12:03 +02:00
ctree.h btrfs: Remove chunk_objectid argument from btrfs_make_block_group 2017-08-21 17:47:42 +02:00
dedupe.h
delayed-inode.c btrfs: increase ctx->pos for delayed dir index 2017-08-18 16:36:20 +02:00
delayed-inode.h
delayed-ref.c Btrfs: return old and new total ref mods when adding delayed refs 2017-06-29 20:17:01 +02:00
delayed-ref.h Btrfs: return old and new total ref mods when adding delayed refs 2017-06-29 20:17:01 +02:00
dev-replace.c btrfs: simplify btrfs_dev_replace_kthread 2017-08-16 16:12:03 +02:00
dev-replace.h
dir-item.c btrfs: fix validation of XATTR_ITEM dir items 2017-06-29 20:06:11 +02:00
disk-io.c btrfs: Do not use data_alloc_cluster in ssd mode 2017-08-21 17:47:42 +02:00
disk-io.h btrfs: use named constant for bdev blocksize 2017-08-16 16:12:04 +02:00
export.c btrfs: Check name_len before reading btrfs_get_name 2017-06-21 19:16:04 +02:00
export.h
extent-tree.c btrfs: Remove chunk_objectid argument from btrfs_make_block_group 2017-08-21 17:47:42 +02:00
extent_io.c Btrfs: fix out of bounds array access while reading extent buffer 2017-08-21 17:47:14 +02:00
extent_io.h btrfs: struct-funcs, constify readers 2017-08-16 14:19:53 +02:00
extent_map.c
extent_map.h
file-item.c Merge branch 'for-4.13-part1' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux 2017-07-05 16:41:23 -07:00
file.c btrfs: fix readdir deadlock with pagefault 2017-08-16 16:12:05 +02:00
free-space-cache.c btrfs: drop newlines from strings when using btrfs_* helpers 2017-08-16 16:12:02 +02:00
free-space-cache.h
free-space-tree.c Btrfs: use memalloc_nofs and kvzalloc() for free space tree bitmaps 2017-06-19 18:26:01 +02:00
free-space-tree.h btrfs: expose internal free space tree routine only if sanity tests are enabled 2017-08-18 16:36:29 +02:00
hash.c crypto: Work around deallocated stack frame reference gcc bug on sparc. 2017-06-08 17:36:03 +08:00
hash.h
inode-item.c
inode-map.c btrfs: qgroup: Introduce extent changeset for qgroup reserve functions 2017-06-29 20:17:02 +02:00
inode-map.h
inode.c btrfs: Move skip checksum check from btrfs_submit_direct to __btrfs_submit_dio_bio 2017-08-18 16:36:29 +02:00
ioctl.c btrfs: Fix -EOVERFLOW handling in btrfs_ioctl_tree_search_v2 2017-08-18 16:36:29 +02:00
Kconfig
locking.c
locking.h
lzo.c btrfs: switch to kvmalloc and GFP_KERNEL in lzo/zlib alloc_workspace 2017-06-19 18:26:02 +02:00
Makefile
math.h
ordered-data.c btrfs: fix integer overflow in calc_reclaim_items_nr 2017-06-29 20:17:02 +02:00
ordered-data.h btrfs: fix integer overflow in calc_reclaim_items_nr 2017-06-29 20:17:02 +02:00
orphan.c
print-tree.c btrfs: get fs_info from eb in btrfs_print_tree, remove argument 2017-08-16 16:12:03 +02:00
print-tree.h btrfs: get fs_info from eb in btrfs_print_tree, remove argument 2017-08-16 16:12:03 +02:00
props.c btrfs: prepare for extensions in compression options 2017-08-16 16:12:05 +02:00
props.h
qgroup.c btrfs: drop newlines from strings when using btrfs_* helpers 2017-08-16 16:12:02 +02:00
qgroup.h btrfs: qgroup: Fix qgroup reserved space underflow by only freeing reserved ranges 2017-06-29 20:17:02 +02:00
raid56.c Merge branch 'for-4.13-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux 2017-07-14 22:55:52 -07:00
raid56.h
rcu-string.h
reada.c btrfs: remove unused member err from reada_extent 2017-06-19 18:25:59 +02:00
relocation.c btrfs: Remove never reached error handling code in __add_reloc_root 2017-08-16 16:12:03 +02:00
root-tree.c btrfs: get fs_info from eb in btrfs_print_leaf, remove argument 2017-08-16 16:12:03 +02:00
scrub.c btrfs: use appropriate define for the fsid 2017-08-18 16:36:29 +02:00
send.c Btrfs: incremental send, fix emission of invalid clone operations 2017-08-21 17:47:42 +02:00
send.h
struct-funcs.c btrfs: struct-funcs, constify readers 2017-08-16 14:19:53 +02:00
super.c btrfs: Do not use data_alloc_cluster in ssd mode 2017-08-21 17:47:42 +02:00
sysfs.c btrfs: Add quota_override knob into sysfs 2017-06-19 18:25:58 +02:00
sysfs.h
transaction.c btrfs: fix integer overflow in calc_reclaim_items_nr 2017-06-29 20:17:02 +02:00
transaction.h
tree-defrag.c
tree-log.c btrfs: Remove extra parentheses from condition in copy_items() 2017-08-21 17:47:42 +02:00
tree-log.h
ulist.c
ulist.h
uuid-tree.c
volumes.c btrfs: Remove extraneous chunk_objectid variable 2017-08-21 17:47:42 +02:00
volumes.h btrfs: Remove unused sectorsize variable from struct map_lookup 2017-08-18 16:36:29 +02:00
xattr.c btrfs: Check name_len with boundary in verify dir_item 2017-06-21 19:16:04 +02:00
xattr.h
zlib.c btrfs: switch to kvmalloc and GFP_KERNEL in lzo/zlib alloc_workspace 2017-06-19 18:26:02 +02:00