android_kernel_samsung_a7y1.../fs/btrfs
Nikolay Borisov 50cc2e72b5 btrfs: handle error of get_old_root
[ Upstream commit 315bed43fea532650933e7bba316a7601d439edf ]

In btrfs_search_old_slot get_old_root is always used with the assumption
it cannot fail. However, this is not true in rare circumstance it can
fail and return null. This will lead to null point dereference when the
header is read. Fix this by checking the return value and properly
handling NULL by setting ret to -EIO and returning gracefully.

Coverity-id: 1087503
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-07 12:34:31 +02:00
..
tests A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
acl.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
async-thread.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
async-thread.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
backref.c Btrfs: do not start a transaction at iterate_extent_inodes() 2020-04-06 18:12:40 +02:00
backref.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
btrfs_inode.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
check-integrity.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
check-integrity.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
compression.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
compression.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ctree.c btrfs: handle error of get_old_root 2020-04-07 12:34:31 +02:00
ctree.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
delayed-inode.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
delayed-inode.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
delayed-ref.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
delayed-ref.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dev-replace.c btrfs: Ensure replaced device doesn't have pending chunk allocation 2020-04-06 19:21:08 +02:00
dev-replace.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
dir-item.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
disk-io.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
disk-io.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
export.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
export.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
extent_io.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
extent_io.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
extent_map.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
extent_map.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
extent-tree.c btrfs: block-group: Fix a memory leak due to missing btrfs_put_block_group() 2020-04-07 09:27:00 +02:00
extent-tree.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
file-item.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
file.c Btrfs: fix race between ranged fsync and writeback of adjacent ranges 2020-04-06 18:15:06 +02:00
free-space-cache.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
free-space-cache.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hash.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hash.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inode-item.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inode-map.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inode-map.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
inode.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ioctl.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
locking.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
lzo.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
math.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ordered-data.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ordered-data.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
orphan.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
print-tree.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
print-tree.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
props.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
props.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
qgroup.c Btrfs: fix race setting up and completing qgroup rescan workers 2020-04-07 07:41:26 +02:00
qgroup.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
raid56.c btrfs: raid56: properly unmap parity page in finish_parity_scrub() 2020-04-06 12:57:22 +02:00
raid56.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rcu-string.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
reada.c btrfs: start readahead also in seed devices 2020-04-06 19:16:44 +02:00
relocation.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
root-tree.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
scrub.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
send.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
send.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
struct-funcs.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
super.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
sysfs.c btrfs: sysfs: don't leak memory when failing add fsid 2020-04-06 18:15:08 +02:00
sysfs.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
transaction.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
transaction.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tree-checker.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tree-checker.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tree-defrag.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
tree-log.c Btrfs: fix assertion failure during fsync and use of stale transaction 2020-04-06 21:35:33 +02:00
tree-log.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ulist.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ulist.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
uuid-tree.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
volumes.c btrfs: fix minimum number of chunk errors for DUP 2020-04-06 20:26:57 +02:00
volumes.h btrfs: Ensure replaced device doesn't have pending chunk allocation 2020-04-06 19:21:08 +02:00
xattr.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xattr.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
zlib.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30