lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 12 Oct 2022 05:00:32 +0800
From:   kernel test robot <lkp@...el.com>
To:     Mark Rutland <mark.rutland@....com>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org
Subject: [mark:arm64/ftrace/minimal-regs 2/5]
 arch/x86/include/asm/ftrace.h:47:25: error: implicit declaration of function
 'ftrace_get_regs' is invalid in C99

Hi Mark,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git arm64/ftrace/minimal-regs
head:   1e840c7ba731d3b9fe5d23a41b3744fa8999ec1e
commit: cfc377737ee03317682a153342d7f30427204591 [2/5] ftrace: pass fregs to arch_ftrace_set_direct_caller()
config: x86_64-buildonly-randconfig-r001-20221010
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git/commit/?id=cfc377737ee03317682a153342d7f30427204591
        git remote add mark https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git
        git fetch --no-tags mark arm64/ftrace/minimal-regs
        git checkout cfc377737ee03317682a153342d7f30427204591
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 prepare

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All error/warnings (new ones prefixed by >>):

   In file included from arch/x86/kernel/asm-offsets.c:22:
   In file included from arch/x86/kernel/../kvm/vmx/vmx.h:5:
   In file included from include/linux/kvm_host.h:32:
   In file included from include/linux/ftrace.h:23:
>> arch/x86/include/asm/ftrace.h:45:57: warning: declaration of 'struct ftrace_regs' will not be visible outside of this function [-Wvisibility]
   static inline void arch_ftrace_set_direct_caller(struct ftrace_regs *fregs, unsigned long addr)
                                                           ^
>> arch/x86/include/asm/ftrace.h:47:25: error: implicit declaration of function 'ftrace_get_regs' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           struct pt_regs *regs = ftrace_get_regs(fregs);
                                  ^
>> arch/x86/include/asm/ftrace.h:47:18: warning: incompatible integer to pointer conversion initializing 'struct pt_regs *' with an expression of type 'int' [-Wint-conversion]
           struct pt_regs *regs = ftrace_get_regs(fregs);
                           ^      ~~~~~~~~~~~~~~~~~~~~~~
   In file included from arch/x86/kernel/asm-offsets.c:22:
   In file included from arch/x86/kernel/../kvm/vmx/vmx.h:5:
   In file included from include/linux/kvm_host.h:32:
   include/linux/ftrace.h:121:40: error: static declaration of 'ftrace_get_regs' follows non-static declaration
   static __always_inline struct pt_regs *ftrace_get_regs(struct ftrace_regs *fregs)
                                          ^
   arch/x86/include/asm/ftrace.h:47:25: note: previous implicit declaration is here
           struct pt_regs *regs = ftrace_get_regs(fregs);
                                  ^
   2 warnings and 2 errors generated.
   make[2]: *** [scripts/Makefile.build:117: arch/x86/kernel/asm-offsets.s] Error 1
   make[2]: Target '__build' not remade because of errors.
   make[1]: *** [Makefile:1205: prepare0] Error 2
   make[1]: Target 'prepare' not remade because of errors.
   make: *** [Makefile:222: __sub-make] Error 2
   make: Target 'prepare' not remade because of errors.


vim +/ftrace_get_regs +47 arch/x86/include/asm/ftrace.h

    37	
    38	/*
    39	 * When a ftrace registered caller is tracing a function that is
    40	 * also set by a register_ftrace_direct() call, it needs to be
    41	 * differentiated in the ftrace_caller trampoline. To do this, we
    42	 * place the direct caller in the ORIG_AX part of pt_regs. This
    43	 * tells the ftrace_caller that there's a direct caller.
    44	 */
  > 45	static inline void arch_ftrace_set_direct_caller(struct ftrace_regs *fregs, unsigned long addr)
    46	{
  > 47		struct pt_regs *regs = ftrace_get_regs(fregs);
    48	
    49		/* Emulate a call */
    50		regs->orig_ax = addr;
    51	}
    52	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (146316 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ