OpenCloudOS-Kernel/fs/btrfs
Sami Tolvanen 4f0f586bf0 treewide: Change list_sort to use const pointers
list_sort() internally casts the comparison function passed to it
to a different type with constant struct list_head pointers, and
uses this pointer to call the functions, which trips indirect call
Control-Flow Integrity (CFI) checking.

Instead of removing the consts, this change defines the
list_cmp_func_t type and changes the comparison function types of
all list_sort() callers to use const pointers, thus avoiding type
mismatches.

Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210408182843.1754385-10-samitolvanen@google.com
2021-04-08 16:04:22 -07:00
..
tests
Kconfig
Makefile btrfs: fix build when using M=fs/btrfs 2021-03-17 19:42:18 +01:00
acl.c
async-thread.c
async-thread.h
backref.c
backref.h
block-group.c
block-group.h
block-rsv.c
block-rsv.h
btrfs_inode.h
check-integrity.c
check-integrity.h
compression.c Merge branch 'kmap-conversion-for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux 2021-03-01 11:24:18 -08:00
compression.h
ctree.c btrfs: fix race when cloning extent buffer during rewind of an old root 2021-03-16 20:32:17 +01:00
ctree.h for-5.12-rc1-tag 2021-03-01 11:17:37 -08:00
delalloc-space.c
delalloc-space.h
delayed-inode.c btrfs: don't flush from btrfs_delayed_inode_reserve_metadata 2021-03-02 17:17:09 +01:00
delayed-inode.h
delayed-ref.c
delayed-ref.h
dev-replace.c btrfs: do not initialize dev replace for bad dev root 2021-03-17 19:42:14 +01:00
dev-replace.h
dir-item.c
discard.c
discard.h
disk-io.c for-5.12-rc4-tag 2021-03-25 15:38:22 -07:00
disk-io.h
export.c
export.h
extent-io-tree.h
extent-tree.c btrfs: always pin deleted leaves when there are active tree mod log users 2021-03-16 20:32:22 +01:00
extent_io.c for-5.12-rc3-tag 2021-03-18 13:38:42 -07:00
extent_io.h
extent_map.c
extent_map.h
file-item.c
file.c for-5.12-rc1-tag 2021-03-05 12:21:14 -08:00
free-space-cache.c btrfs: zoned: do not account freed region of read-only block group as zone_unusable 2021-03-04 16:16:58 +01:00
free-space-cache.h
free-space-tree.c
free-space-tree.h
inode-item.c
inode.c for-5.12-rc4-tag 2021-03-25 15:38:22 -07:00
ioctl.c for-5.12-rc1-tag 2021-03-05 12:21:14 -08:00
locking.c
locking.h
lzo.c
misc.h
ordered-data.c
ordered-data.h
orphan.c
print-tree.c
print-tree.h
props.c
props.h
qgroup.c btrfs: fix sleep while in non-sleep context during qgroup removal 2021-03-18 16:53:24 +01:00
qgroup.h btrfs: export and rename qgroup_reserve_meta 2021-03-02 16:58:30 +01:00
raid56.c treewide: Change list_sort to use const pointers 2021-04-08 16:04:22 -07:00
raid56.h
rcu-string.h
reada.c btrfs: subpage: make readahead work properly 2021-03-16 11:06:21 +01:00
ref-verify.c btrfs: ref-verify: use 'inline void' keyword ordering 2021-03-02 16:55:40 +01:00
ref-verify.h
reflink.c Merge branch 'kmap-conversion-for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux 2021-03-01 11:24:18 -08:00
reflink.h
relocation.c
root-tree.c
scrub.c block-5.12-2021-03-12-v2 2021-03-12 13:25:49 -08:00
send.c Merge branch 'kmap-conversion-for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux 2021-03-01 11:24:18 -08:00
send.h
space-info.c
space-info.h
struct-funcs.c
subpage.c
subpage.h
super.c btrfs: fix spurious free_space_tree remount warning 2021-03-02 16:55:55 +01:00
sysfs.c
sysfs.h
transaction.c
transaction.h
tree-checker.c
tree-checker.h
tree-defrag.c
tree-log.c treewide: Change list_sort to use const pointers 2021-04-08 16:04:22 -07:00
tree-log.h
ulist.c
ulist.h
uuid-tree.c
volumes.c treewide: Change list_sort to use const pointers 2021-04-08 16:04:22 -07:00
volumes.h
xattr.c for-5.12-rc1-tag 2021-03-05 12:21:14 -08:00
xattr.h
zlib.c
zoned.c for-5.12-rc1-tag 2021-03-05 12:21:14 -08:00
zoned.h
zstd.c