Re: [linux-next:master 12285/12641] include/linux/kasan-checks.h:25:20: error: inlining failed in call to always_inline 'kasan_check_read': function attribute mismatch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Confirmed that reverting the series fixed the compilation error on x86.

254fb04d207a Revert "mm/kasan: introduce __kasan_check_{read,write}"
ea13ff3c419e Revert "mm/kasan: change kasan_check_{read,write} to return
boolean"
f985089f2720 Revert "mm/kasan: include types.h for "bool""
189d618780b9 Revert "lib/test_kasan: Add test for double-kzfree detection"
9ff8c87f0bc1 Revert "mm/slab: refactor common ksize KASAN logic into
slab_common.c"
f70e2a0186e8 Revert "mm/kasan: add object validation in ksize()"
d9cc021b1ab1 Revert "mm-kasan-add-object-validation-in-ksize-v4"

In file included from ./include/linux/compiler.h:257,
                 from ./arch/x86/include/asm/current.h:5,
                 from ./include/linux/sched.h:12,
                 from ./include/linux/ratelimit.h:6,
                 from fs/dcache.c:18:
./include/linux/compiler.h: In function ‘read_word_at_a_time’:
./include/linux/kasan-checks.h:31:20: error: inlining failed in call to
always_inline ‘kasan_check_read’: function attribute mismatch
 static inline bool kasan_check_read(const volatile void *p, unsigned int size)
                    ^~~~~~~~~~~~~~~~
In file included from ./arch/x86/include/asm/current.h:5,
                 from ./include/linux/sched.h:12,
                 from ./include/linux/ratelimit.h:6,
                 from fs/dcache.c:18:
./include/linux/compiler.h:280:2: note: called from here
  kasan_check_read(addr, 1);
  ^~~~~~~~~~~~~~~~~~~~~~~~~
make[1]: *** [scripts/Makefile.build:279: fs/dcache.o] Error 1

On Fri, 2019-07-05 at 21:51 +0800, kbuild test robot wrote:
> tree:   https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-ne
> xt.git master
> head:   22c45ec32b4a9fa8c48ef4f5bf9b189b307aae12
> commit: 452b72b9f28f8bdf0e030c827f2b366d4661fd50 [12285/12641] mm/kasan:
> introduce __kasan_check_{read,write}
> config: x86_64-randconfig-s1-07051907 (attached as .config)
> compiler: gcc-7 (Debian 7.4.0-9) 7.4.0
> reproduce:
>         git checkout 452b72b9f28f8bdf0e030c827f2b366d4661fd50
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <lkp@xxxxxxxxx>
> 
> All errors (new ones prefixed by >>):
> 
>    Cyclomatic Complexity 6 fs/dcache.c:d_same_name
>    Cyclomatic Complexity 1 fs/dcache.c:__d_rehash
>    Cyclomatic Complexity 1 fs/dcache.c:d_rehash
>    Cyclomatic Complexity 4 fs/dcache.c:start_dir_add
>    Cyclomatic Complexity 1 fs/dcache.c:end_dir_add
>    Cyclomatic Complexity 12 fs/dcache.c:__d_add
>    Cyclomatic Complexity 9 fs/dcache.c:__d_find_alias
>    Cyclomatic Complexity 3 fs/dcache.c:d_find_alias
>    Cyclomatic Complexity 14 fs/dcache.c:d_exact_alias
>    Cyclomatic Complexity 10 fs/dcache.c:d_genocide_kill
>    Cyclomatic Complexity 4 fs/dcache.c:dcache_init_early
>    Cyclomatic Complexity 4 fs/dcache.c:dcache_init
>    Cyclomatic Complexity 2 fs/dcache.c:get_nr_dentry
>    Cyclomatic Complexity 2 fs/dcache.c:get_nr_dentry_unused
>    Cyclomatic Complexity 2 fs/dcache.c:get_nr_dentry_negative
>    Cyclomatic Complexity 3 fs/dcache.c:___d_drop
>    Cyclomatic Complexity 3 fs/dcache.c:__d_drop
>    Cyclomatic Complexity 1 fs/dcache.c:d_drop
>    Cyclomatic Complexity 6 fs/dcache.c:__lock_parent
>    Cyclomatic Complexity 21 fs/dcache.c:shrink_lock_dentry
>    Cyclomatic Complexity 3 fs/dcache.c:d_shrink_del
>    Cyclomatic Complexity 5 fs/dcache.c:path_check_mount
>    Cyclomatic Complexity 3 fs/dcache.c:d_shrink_add
>    Cyclomatic Complexity 29 fs/dcache.c:d_set_d_op
>    Cyclomatic Complexity 19 fs/dcache.c:d_flags_for_inode
>    Cyclomatic Complexity 6 fs/dcache.c:__d_instantiate
>    Cyclomatic Complexity 3 fs/dcache.c:take_dentry_name_snapshot
>    Cyclomatic Complexity 8 fs/dcache.c:swap_names
>    Cyclomatic Complexity 5 fs/dcache.c:release_dentry_name_snapshot
>    Cyclomatic Complexity 8 fs/dcache.c:copy_name
>    Cyclomatic Complexity 7 fs/dcache.c:d_lru_add
>    Cyclomatic Complexity 7 fs/dcache.c:d_lru_del
>    Cyclomatic Complexity 16 fs/dcache.c:select_collect
>    Cyclomatic Complexity 12 fs/dcache.c:dentry_unlink_inode
>    Cyclomatic Complexity 1 fs/dcache.c:__d_free_external
>    Cyclomatic Complexity 1 fs/dcache.c:__d_free
>    Cyclomatic Complexity 10 fs/dcache.c:dentry_free
>    Cyclomatic Complexity 32 fs/dcache.c:__dentry_kill
>    Cyclomatic Complexity 28 fs/dcache.c:dentry_kill
>    Cyclomatic Complexity 6 fs/dcache.c:dput
>    Cyclomatic Complexity 12 fs/dcache.c:d_prune_aliases
>    Cyclomatic Complexity 15 fs/dcache.c:shrink_dentry_list
>    Cyclomatic Complexity 2 fs/dcache.c:shrink_dcache_sb
>    Cyclomatic Complexity 8 fs/dcache.c:dget_parent
>    Cyclomatic Complexity 5 fs/dcache.c:d_lru_isolate
>    Cyclomatic Complexity 5 fs/dcache.c:d_lru_shrink_move
>    Cyclomatic Complexity 9 fs/dcache.c:dentry_lru_isolate
>    Cyclomatic Complexity 3 fs/dcache.c:dentry_lru_isolate_shrink
>    Cyclomatic Complexity 26 fs/dcache.c:d_walk
>    Cyclomatic Complexity 1 fs/dcache.c:path_has_submounts
>    Cyclomatic Complexity 6 fs/dcache.c:shrink_dcache_parent
>    Cyclomatic Complexity 1 fs/dcache.c:do_one_tree
>    Cyclomatic Complexity 12 fs/dcache.c:d_invalidate
>    Cyclomatic Complexity 1 fs/dcache.c:d_genocide
>    Cyclomatic Complexity 14 fs/dcache.c:umount_check
>    Cyclomatic Complexity 5 fs/dcache.c:d_instantiate
>    Cyclomatic Complexity 10 fs/dcache.c:__d_instantiate_anon
>    Cyclomatic Complexity 1 fs/dcache.c:d_instantiate_anon
>    Cyclomatic Complexity 4 fs/dcache.c:d_add
>    Cyclomatic Complexity 5 fs/dcache.c:d_instantiate_new
>    Cyclomatic Complexity 4 fs/dcache.c:d_delete
>    Cyclomatic Complexity 6 fs/dcache.c:d_wait_lookup
>    Cyclomatic Complexity 1 fs/dcache.c:__d_lookup_done
>    Cyclomatic Complexity 6 fs/dcache.c:d_tmpfile
>    Cyclomatic Complexity 4 fs/dcache.c:set_dhash_entries
>    Cyclomatic Complexity 2 fs/dcache.c:vfs_caches_init_early
>    Cyclomatic Complexity 1 fs/dcache.c:vfs_caches_init
>    Cyclomatic Complexity 1 fs/dcache.c:proc_nr_dentry
>    Cyclomatic Complexity 1 fs/dcache.c:prune_dcache_sb
>    Cyclomatic Complexity 8 fs/dcache.c:d_set_mounted
>    Cyclomatic Complexity 4 fs/dcache.c:shrink_dcache_for_umount
>    Cyclomatic Complexity 25 fs/dcache.c:__d_alloc
>    Cyclomatic Complexity 4 fs/dcache.c:d_alloc
>    Cyclomatic Complexity 1 fs/dcache.c:d_alloc_name
>    Cyclomatic Complexity 1 fs/dcache.c:d_alloc_anon
>    Cyclomatic Complexity 7 fs/dcache.c:d_make_root
>    Cyclomatic Complexity 12 fs/dcache.c:__d_obtain_alias
>    Cyclomatic Complexity 1 fs/dcache.c:d_obtain_alias
>    Cyclomatic Complexity 1 fs/dcache.c:d_obtain_root
>    Cyclomatic Complexity 4 fs/dcache.c:d_alloc_cursor
>    Cyclomatic Complexity 3 fs/dcache.c:d_alloc_pseudo
>    Cyclomatic Complexity 22 fs/dcache.c:__d_lookup_rcu
>    Cyclomatic Complexity 35 fs/dcache.c:d_alloc_parallel
>    Cyclomatic Complexity 13 fs/dcache.c:__d_lookup
>    Cyclomatic Complexity 5 fs/dcache.c:d_lookup
>    Cyclomatic Complexity 6 fs/dcache.c:d_hash_and_lookup
>    Cyclomatic Complexity 5 fs/dcache.c:d_ancestor
>    Cyclomatic Complexity 42 fs/dcache.c:__d_move
>    Cyclomatic Complexity 1 fs/dcache.c:d_move
>    Cyclomatic Complexity 9 fs/dcache.c:d_exchange
>    Cyclomatic Complexity 14 fs/dcache.c:__d_unalias
>    Cyclomatic Complexity 22 fs/dcache.c:d_splice_alias
>    Cyclomatic Complexity 15 fs/dcache.c:d_add_ci
>    Cyclomatic Complexity 7 fs/dcache.c:is_subdir
>    In file included from include/linux/compiler.h:252:0,
>                     from arch/x86/include/asm/current.h:5,
>                     from include/linux/sched.h:12,
>                     from include/linux/ratelimit.h:6,
>                     from fs/dcache.c:18:
>    include/linux/compiler.h: In function 'read_word_at_a_time':
> > > include/linux/kasan-checks.h:25:20: error: inlining failed in call to
> > > always_inline 'kasan_check_read': function attribute mismatch
> 
>     static inline void kasan_check_read(const volatile void *p, unsigned int
> size)
>                        ^~~~~~~~~~~~~~~~
>    In file included from arch/x86/include/asm/current.h:5:0,
>                     from include/linux/sched.h:12,
>                     from include/linux/ratelimit.h:6,
>                     from fs/dcache.c:18:
>    include/linux/compiler.h:275:2: note: called from here
>      kasan_check_read(addr, 1);
>      ^~~~~~~~~~~~~~~~~~~~~~~~~
> --
>    Cyclomatic Complexity 1 include/linux/kasan-checks.h:kasan_check_read
>    Cyclomatic Complexity 1 include/linux/compiler.h:read_word_at_a_time
>    Cyclomatic Complexity 4 include/linux/ctype.h:__tolower
>    Cyclomatic Complexity 1 arch/x86/include/asm/word-at-a-
> time.h:count_masked_bytes
>    Cyclomatic Complexity 1 arch/x86/include/asm/word-at-a-time.h:has_zero
>    Cyclomatic Complexity 1 arch/x86/include/asm/word-at-a-
> time.h:prep_zero_mask
>    Cyclomatic Complexity 1 arch/x86/include/asm/word-at-a-
> time.h:create_zero_mask
>    Cyclomatic Complexity 1 arch/x86/include/asm/word-at-a-time.h:find_zero
>    Cyclomatic Complexity 2 lib/string.c:strcasecmp
>    Cyclomatic Complexity 2 lib/string.c:strcpy
>    Cyclomatic Complexity 4 lib/string.c:strncpy
>    Cyclomatic Complexity 3 lib/string.c:strcat
>    Cyclomatic Complexity 3 lib/string.c:strchrnul
>    Cyclomatic Complexity 2 lib/string.c:skip_spaces
>    Cyclomatic Complexity 2 lib/string.c:strlen
>    Cyclomatic Complexity 3 lib/string.c:strnlen
>    Cyclomatic Complexity 4 lib/string.c:memcmp
>    Cyclomatic Complexity 1 lib/string.c:bcmp
>    Cyclomatic Complexity 4 lib/string.c:memchr
>    Cyclomatic Complexity 14 lib/string.c:strncasecmp
>    Cyclomatic Complexity 20 lib/string.c:strscpy
>    Cyclomatic Complexity 8 lib/string.c:strncat
>    Cyclomatic Complexity 8 lib/string.c:strcmp
>    Cyclomatic Complexity 9 lib/string.c:strncmp
>    Cyclomatic Complexity 5 lib/string.c:strchr
>    Cyclomatic Complexity 5 lib/string.c:strrchr
>    Cyclomatic Complexity 6 lib/string.c:strnchr
>    Cyclomatic Complexity 6 lib/string.c:strim
>    Cyclomatic Complexity 9 lib/string.c:strspn
>    Cyclomatic Complexity 6 lib/string.c:strcspn
>    Cyclomatic Complexity 6 lib/string.c:strpbrk
>    Cyclomatic Complexity 7 lib/string.c:strsep
>    Cyclomatic Complexity 28 lib/string.c:sysfs_streq
>    Cyclomatic Complexity 8 lib/string.c:match_string
>    Cyclomatic Complexity 7 lib/string.c:__sysfs_match_string
>    Cyclomatic Complexity 5 lib/string.c:memscan
>    Cyclomatic Complexity 8 lib/string.c:strstr
>    Cyclomatic Complexity 8 lib/string.c:strnstr
>    Cyclomatic Complexity 5 lib/string.c:check_bytes8
>    Cyclomatic Complexity 14 lib/string.c:memchr_inv
>    Cyclomatic Complexity 5 lib/string.c:strreplace
>    Cyclomatic Complexity 5 lib/string.c:strlcpy
>    Cyclomatic Complexity 9 lib/string.c:strscpy_pad
>    Cyclomatic Complexity 1 lib/string.c:memzero_explicit
>    Cyclomatic Complexity 5 lib/string.c:strlcat
>    Cyclomatic Complexity 0 lib/string.c:fortify_panic
>    In file included from include/linux/compiler.h:252:0,
>                     from include/linux/string.h:6,
>                     from lib/string.c:24:
>    include/linux/compiler.h: In function 'read_word_at_a_time':
> > > include/linux/kasan-checks.h:25:20: error: inlining failed in call to
> > > always_inline 'kasan_check_read': function attribute mismatch
> 
>     static inline void kasan_check_read(const volatile void *p, unsigned int
> size)
>                        ^~~~~~~~~~~~~~~~
>    In file included from include/linux/string.h:6:0,
>                     from lib/string.c:24:
>    include/linux/compiler.h:275:2: note: called from here
>      kasan_check_read(addr, 1);
>      ^~~~~~~~~~~~~~~~~~~~~~~~~
> 
> vim +/kasan_check_read +25 include/linux/kasan-checks.h
> 
>     19	
>     20	/*
>     21	 * kasan_check_*: Only available when the particular compilation
> unit has KASAN
>     22	 * instrumentation enabled. May be used in header files.
>     23	 */
>     24	#ifdef __SANITIZE_ADDRESS__
>   > 25	static inline void kasan_check_read(const volatile void *p,
> unsigned int size)
>     26	{
>     27		__kasan_check_read(p, size);
>     28	}
>     29	static inline void kasan_check_write(const volatile void *p,
> unsigned int size)
>     30	{
>     31		__kasan_check_read(p, size);
>     32	}
>     33	#else
>     34	static inline void kasan_check_read(const volatile void *p,
> unsigned int size)
>     35	{ }
>     36	static inline void kasan_check_write(const volatile void *p,
> unsigned int size)
>     37	{ }
>     38	#endif
>     39	
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux