linux/fs/ntfs
Luca Stefani 1146f7e2dc ntfs: fix ntfs_test_inode and ntfs_init_locked_inode function type
Clang's Control Flow Integrity (CFI) is a security mechanism that can help
prevent JOP chains, deployed extensively in downstream kernels used in
Android.

Its deployment is hindered by mismatches in function signatures.  For this
case, we make callbacks match their intended function signature, and cast
parameters within them rather than casting the callback when passed as a
parameter.

When running `mount -t ntfs ...` we observe the following trace:

Call trace:
__cfi_check_fail+0x1c/0x24
name_to_dev_t+0x0/0x404
iget5_locked+0x594/0x5e8
ntfs_fill_super+0xbfc/0x43ec
mount_bdev+0x30c/0x3cc
ntfs_mount+0x18/0x24
mount_fs+0x1b0/0x380
vfs_kern_mount+0x90/0x398
do_mount+0x5d8/0x1a10
SyS_mount+0x108/0x144
el0_svc_naked+0x34/0x38

Signed-off-by: Luca Stefani <luca.stefani.ge1@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Tested-by: freak07 <michalechner92@googlemail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Acked-by: Anton Altaparmakov <anton@tuxera.com>
Link: http://lkml.kernel.org/r/20200718112513.533800-1-luca.stefani.ge1@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-08-07 11:33:21 -07:00
..
aops.c ntfs: replace attach_page_buffers with attach_page_private 2020-06-02 10:59:07 -07:00
aops.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
attrib.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
attrib.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
bitmap.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
bitmap.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
collate.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
collate.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
compress.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
debug.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
debug.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
dir.c ntfs: fix ntfs_test_inode and ntfs_init_locked_inode function type 2020-08-07 11:33:21 -07:00
dir.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
endian.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
file.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
index.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
index.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
inode.c ntfs: fix ntfs_test_inode and ntfs_init_locked_inode function type 2020-08-07 11:33:21 -07:00
inode.h ntfs: fix ntfs_test_inode and ntfs_init_locked_inode function type 2020-08-07 11:33:21 -07:00
Kconfig docs: filesystems: fix renamed references 2020-04-20 15:45:22 -06:00
layout.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
lcnalloc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
lcnalloc.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
logfile.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
logfile.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
malloc.h mm: remove the pgprot argument to __vmalloc 2020-06-02 10:59:11 -07:00
mft.c ntfs: fix ntfs_test_inode and ntfs_init_locked_inode function type 2020-08-07 11:33:21 -07:00
mft.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
mst.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
namei.c ntfs: remove (un)?likely() from IS_ERR() conditions 2019-09-26 10:10:44 -07:00
ntfs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
quota.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
quota.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
runlist.c ntfs: remove (un)?likely() from IS_ERR() conditions 2019-09-26 10:10:44 -07:00
runlist.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
super.c ntfs: remove (un)?likely() from IS_ERR() conditions 2019-09-26 10:10:44 -07:00
sysctl.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
sysctl.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
time.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
types.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
unistr.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
upcase.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 97 2019-05-24 17:37:53 +02:00
usnjrnl.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
usnjrnl.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00
volume.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 96 2019-05-24 17:37:53 +02:00