[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202209160604.NdyU8HJP-lkp@intel.com>
Date: Fri, 16 Sep 2022 06:16:09 +0800
From: kernel test robot <lkp@...el.com>
To: Micah Morton <mortonm@...omium.org>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
Dmitry Torokhov <dtor@...omium.org>
Subject: [jsarha:topic/cros-sof-v4.14-rebase 3442/9999]
arch/arm64/include/asm/syscall.h:30:13: error: dereferencing pointer to
incomplete type 'struct pt_regs'
tree: https://github.com/jsarha/linux topic/cros-sof-v4.14-rebase
head: 18a233f3f676a98dde00947535d99ab1a54da340
commit: 57aeee2a884911a0a86042e8e16f02920195c541 [3442/9999] CHROMIUM: Add process mgmt security policies to chromiumos LSM
config: arm64-randconfig-r001-20220915
compiler: aarch64-linux-gcc (GCC) 7.5.0
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://github.com/jsarha/linux/commit/57aeee2a884911a0a86042e8e16f02920195c541
git remote add jsarha https://github.com/jsarha/linux
git fetch --no-tags jsarha topic/cros-sof-v4.14-rebase
git checkout 57aeee2a884911a0a86042e8e16f02920195c541
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-7.5.0 make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash M=security/chromiumos
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 security/chromiumos/lsm.c:22:0:
>> arch/arm64/include/asm/syscall.h:28:13: warning: 'struct pt_regs' declared inside parameter list will not be visible outside of this definition or declaration
struct pt_regs *regs)
^~~~~~~
>> arch/arm64/include/asm/syscall.h:27:41: warning: 'struct task_struct' declared inside parameter list will not be visible outside of this definition or declaration
static inline int syscall_get_nr(struct task_struct *task,
^~~~~~~~~~~
arch/arm64/include/asm/syscall.h: In function 'syscall_get_nr':
>> arch/arm64/include/asm/syscall.h:30:13: error: dereferencing pointer to incomplete type 'struct pt_regs'
return regs->syscallno;
^~
arch/arm64/include/asm/syscall.h: At top level:
arch/arm64/include/asm/syscall.h:34:16: warning: 'struct pt_regs' declared inside parameter list will not be visible outside of this definition or declaration
struct pt_regs *regs)
^~~~~~~
arch/arm64/include/asm/syscall.h:33:44: warning: 'struct task_struct' declared inside parameter list will not be visible outside of this definition or declaration
static inline void syscall_rollback(struct task_struct *task,
^~~~~~~~~~~
arch/arm64/include/asm/syscall.h: In function 'syscall_rollback':
arch/arm64/include/asm/syscall.h:36:6: error: dereferencing pointer to incomplete type 'struct pt_regs'
regs->regs[0] = regs->orig_x0;
^~
arch/arm64/include/asm/syscall.h: At top level:
arch/arm64/include/asm/syscall.h:41:17: warning: 'struct pt_regs' declared inside parameter list will not be visible outside of this definition or declaration
struct pt_regs *regs)
^~~~~~~
arch/arm64/include/asm/syscall.h:40:45: warning: 'struct task_struct' declared inside parameter list will not be visible outside of this definition or declaration
static inline long syscall_get_error(struct task_struct *task,
^~~~~~~~~~~
arch/arm64/include/asm/syscall.h: In function 'syscall_get_error':
arch/arm64/include/asm/syscall.h:43:28: error: dereferencing pointer to incomplete type 'struct pt_regs'
unsigned long error = regs->regs[0];
^~
arch/arm64/include/asm/syscall.h: At top level:
arch/arm64/include/asm/syscall.h:48:17: warning: 'struct pt_regs' declared inside parameter list will not be visible outside of this definition or declaration
struct pt_regs *regs)
^~~~~~~
arch/arm64/include/asm/syscall.h:47:52: warning: 'struct task_struct' declared inside parameter list will not be visible outside of this definition or declaration
static inline long syscall_get_return_value(struct task_struct *task,
^~~~~~~~~~~
arch/arm64/include/asm/syscall.h: In function 'syscall_get_return_value':
arch/arm64/include/asm/syscall.h:50:13: error: dereferencing pointer to incomplete type 'struct pt_regs'
return regs->regs[0];
^~
arch/arm64/include/asm/syscall.h: At top level:
arch/arm64/include/asm/syscall.h:54:17: warning: 'struct pt_regs' declared inside parameter list will not be visible outside of this definition or declaration
struct pt_regs *regs,
^~~~~~~
arch/arm64/include/asm/syscall.h:53:52: warning: 'struct task_struct' declared inside parameter list will not be visible outside of this definition or declaration
static inline void syscall_set_return_value(struct task_struct *task,
^~~~~~~~~~~
arch/arm64/include/asm/syscall.h: In function 'syscall_set_return_value':
arch/arm64/include/asm/syscall.h:57:6: error: dereferencing pointer to incomplete type 'struct pt_regs'
regs->regs[0] = (long) error ? error : val;
^~
arch/arm64/include/asm/syscall.h: At top level:
arch/arm64/include/asm/syscall.h:63:14: warning: 'struct pt_regs' declared inside parameter list will not be visible outside of this definition or declaration
struct pt_regs *regs,
^~~~~~~
arch/arm64/include/asm/syscall.h:62:49: warning: 'struct task_struct' declared inside parameter list will not be visible outside of this definition or declaration
static inline void syscall_get_arguments(struct task_struct *task,
^~~~~~~~~~~
arch/arm64/include/asm/syscall.h: In function 'syscall_get_arguments':
>> arch/arm64/include/asm/syscall.h:73:3: error: implicit declaration of function 'pr_warning' [-Werror=implicit-function-declaration]
pr_warning("%s called with max args %d, handling only %d\n",
^~~~~~~~~~
>> arch/arm64/include/asm/syscall.h:75:3: error: implicit declaration of function 'memset' [-Werror=implicit-function-declaration]
memset(args_bad, 0, n_bad * sizeof(args[0]));
^~~~~~
>> arch/arm64/include/asm/syscall.h:75:3: warning: incompatible implicit declaration of built-in function 'memset'
arch/arm64/include/asm/syscall.h:75:3: note: include '<string.h>' or provide a declaration of 'memset'
arch/arm64/include/asm/syscall.h:79:17: error: dereferencing pointer to incomplete type 'struct pt_regs'
args[0] = regs->orig_x0;
^~
>> arch/arm64/include/asm/syscall.h:85:2: error: implicit declaration of function 'memcpy' [-Werror=implicit-function-declaration]
memcpy(args, ®s->regs[i], n * sizeof(args[0]));
^~~~~~
>> arch/arm64/include/asm/syscall.h:85:2: warning: incompatible implicit declaration of built-in function 'memcpy'
arch/arm64/include/asm/syscall.h:85:2: note: include '<string.h>' or provide a declaration of 'memcpy'
arch/arm64/include/asm/syscall.h: At top level:
arch/arm64/include/asm/syscall.h:89:14: warning: 'struct pt_regs' declared inside parameter list will not be visible outside of this definition or declaration
struct pt_regs *regs,
^~~~~~~
arch/arm64/include/asm/syscall.h:88:49: warning: 'struct task_struct' declared inside parameter list will not be visible outside of this definition or declaration
static inline void syscall_set_arguments(struct task_struct *task,
^~~~~~~~~~~
arch/arm64/include/asm/syscall.h: In function 'syscall_set_arguments':
arch/arm64/include/asm/syscall.h:103:7: error: dereferencing pointer to incomplete type 'struct pt_regs'
regs->orig_x0 = args[0];
^~
arch/arm64/include/asm/syscall.h:109:2: warning: incompatible implicit declaration of built-in function 'memcpy'
memcpy(®s->regs[i], args, n * sizeof(args[0]));
^~~~~~
arch/arm64/include/asm/syscall.h:109:2: note: include '<string.h>' or provide a declaration of 'memcpy'
security/chromiumos/lsm.c: At top level:
security/chromiumos/lsm.c:243:6: warning: no previous declaration for 'chromiumos_check_setuid_policy_hashtable_key' [-Wmissing-declarations]
bool chromiumos_check_setuid_policy_hashtable_key(kuid_t parent)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
security/chromiumos/lsm.c:267:6: warning: no previous declaration for 'chromiumos_check_setuid_policy_hashtable_key_value' [-Wmissing-declarations]
bool chromiumos_check_setuid_policy_hashtable_key_value(kuid_t parent,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
security/chromiumos/lsm.c:293:6: warning: no previous declaration for 'setuid_syscall' [-Wmissing-declarations]
bool setuid_syscall(int num)
^~~~~~~~~~~~~~
security/chromiumos/lsm.c: In function 'setuid_syscall':
security/chromiumos/lsm.c:302:15: error: '__NR_compat_setuid' undeclared (first use in this function); did you mean '__NR_io_setup'?
if (!(num == __NR_compat_setuid ||
^~~~~~~~~~~~~~~~~~
__NR_io_setup
security/chromiumos/lsm.c:302:15: note: each undeclared identifier is reported only once for each function it appears in
security/chromiumos/lsm.c:303:15: error: '__NR_compat_setreuid' undeclared (first use in this function); did you mean '__NR_compat_setuid'?
num == __NR_compat_setreuid ||
^~~~~~~~~~~~~~~~~~~~
__NR_compat_setuid
security/chromiumos/lsm.c:304:15: error: '__NR_compat_setfsuid' undeclared (first use in this function); did you mean '__NR_compat_setreuid'?
num == __NR_compat_setfsuid ||
^~~~~~~~~~~~~~~~~~~~
__NR_compat_setreuid
security/chromiumos/lsm.c:305:15: error: '__NR_compat_setresuid' undeclared (first use in this function); did you mean '__NR_compat_setreuid'?
num == __NR_compat_setresuid ||
^~~~~~~~~~~~~~~~~~~~~
__NR_compat_setreuid
security/chromiumos/lsm.c:306:15: error: '__NR_compat_setreuid32' undeclared (first use in this function); did you mean '__NR_compat_setreuid'?
num == __NR_compat_setreuid32 ||
^~~~~~~~~~~~~~~~~~~~~~
__NR_compat_setreuid
security/chromiumos/lsm.c:307:15: error: '__NR_compat_setresuid32' undeclared (first use in this function); did you mean '__NR_compat_setreuid32'?
num == __NR_compat_setresuid32 ||
^~~~~~~~~~~~~~~~~~~~~~~
__NR_compat_setreuid32
security/chromiumos/lsm.c:308:15: error: '__NR_compat_setuid32' undeclared (first use in this function); did you mean '__NR_compat_setreuid32'?
num == __NR_compat_setuid32 ||
^~~~~~~~~~~~~~~~~~~~
__NR_compat_setreuid32
security/chromiumos/lsm.c:309:15: error: '__NR_compat_setfsuid32' undeclared (first use in this function); did you mean '__NR_compat_setuid32'?
num == __NR_compat_setfsuid32))
^~~~~~~~~~~~~~~~~~~~~~
__NR_compat_setuid32
security/chromiumos/lsm.c: At top level:
security/chromiumos/lsm.c:321:5: warning: no previous declaration for 'chromiumos_security_capable' [-Wmissing-declarations]
int chromiumos_security_capable(const struct cred *cred,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/thread_info.h:21:0,
from include/asm-generic/preempt.h:5,
from ./arch/arm64/include/generated/asm/preempt.h:1,
from include/linux/preempt.h:81,
from include/linux/rcupdate.h:40,
from include/linux/rbtree.h:34,
from include/linux/key.h:20,
from include/linux/cred.h:17,
from security/chromiumos/lsm.c:23:
security/chromiumos/lsm.c: In function 'chromiumos_security_capable':
arch/arm64/include/asm/current.h:24:17: error: passing argument 1 of 'syscall_get_nr' from incompatible pointer type [-Werror=incompatible-pointer-types]
#define current get_current()
^
security/chromiumos/lsm.c:334:39: note: in expansion of macro 'current'
if (!(setuid_syscall(syscall_get_nr(current,
^~~~~~~
In file included from security/chromiumos/lsm.c:22:0:
arch/arm64/include/asm/syscall.h:27:19: note: expected 'struct task_struct *' but argument is of type 'struct task_struct *'
static inline int syscall_get_nr(struct task_struct *task,
^~~~~~~~~~~~~~
In file included from include/linux/rcupdate.h:43:0,
from include/linux/rbtree.h:34,
from include/linux/key.h:20,
from include/linux/cred.h:17,
from security/chromiumos/lsm.c:23:
arch/arm64/include/asm/processor.h:185:2: error: passing argument 2 of 'syscall_get_nr' from incompatible pointer type [-Werror=incompatible-pointer-types]
((struct pt_regs *)(THREAD_SIZE + task_stack_page(p)) - 1)
^
include/linux/ptrace.h:392:27: note: in expansion of macro 'task_pt_regs'
#define current_pt_regs() task_pt_regs(current)
^~~~~~~~~~~~
security/chromiumos/lsm.c:335:11: note: in expansion of macro 'current_pt_regs'
current_pt_regs()))))
^~~~~~~~~~~~~~~
In file included from security/chromiumos/lsm.c:22:0:
arch/arm64/include/asm/syscall.h:27:19: note: expected 'struct pt_regs *' but argument is of type 'struct pt_regs *'
vim +30 arch/arm64/include/asm/syscall.h
f27bb139c387680 Marc Zyngier 2012-03-05 26
f27bb139c387680 Marc Zyngier 2012-03-05 @27 static inline int syscall_get_nr(struct task_struct *task,
f27bb139c387680 Marc Zyngier 2012-03-05 @28 struct pt_regs *regs)
f27bb139c387680 Marc Zyngier 2012-03-05 29 {
f27bb139c387680 Marc Zyngier 2012-03-05 @30 return regs->syscallno;
f27bb139c387680 Marc Zyngier 2012-03-05 31 }
f27bb139c387680 Marc Zyngier 2012-03-05 32
f27bb139c387680 Marc Zyngier 2012-03-05 33 static inline void syscall_rollback(struct task_struct *task,
f27bb139c387680 Marc Zyngier 2012-03-05 34 struct pt_regs *regs)
f27bb139c387680 Marc Zyngier 2012-03-05 35 {
f27bb139c387680 Marc Zyngier 2012-03-05 36 regs->regs[0] = regs->orig_x0;
f27bb139c387680 Marc Zyngier 2012-03-05 37 }
f27bb139c387680 Marc Zyngier 2012-03-05 38
f27bb139c387680 Marc Zyngier 2012-03-05 39
f27bb139c387680 Marc Zyngier 2012-03-05 40 static inline long syscall_get_error(struct task_struct *task,
f27bb139c387680 Marc Zyngier 2012-03-05 41 struct pt_regs *regs)
f27bb139c387680 Marc Zyngier 2012-03-05 42 {
f27bb139c387680 Marc Zyngier 2012-03-05 43 unsigned long error = regs->regs[0];
f27bb139c387680 Marc Zyngier 2012-03-05 44 return IS_ERR_VALUE(error) ? error : 0;
f27bb139c387680 Marc Zyngier 2012-03-05 45 }
f27bb139c387680 Marc Zyngier 2012-03-05 46
f27bb139c387680 Marc Zyngier 2012-03-05 47 static inline long syscall_get_return_value(struct task_struct *task,
f27bb139c387680 Marc Zyngier 2012-03-05 48 struct pt_regs *regs)
f27bb139c387680 Marc Zyngier 2012-03-05 49 {
f27bb139c387680 Marc Zyngier 2012-03-05 50 return regs->regs[0];
f27bb139c387680 Marc Zyngier 2012-03-05 51 }
f27bb139c387680 Marc Zyngier 2012-03-05 52
f27bb139c387680 Marc Zyngier 2012-03-05 53 static inline void syscall_set_return_value(struct task_struct *task,
f27bb139c387680 Marc Zyngier 2012-03-05 54 struct pt_regs *regs,
f27bb139c387680 Marc Zyngier 2012-03-05 55 int error, long val)
f27bb139c387680 Marc Zyngier 2012-03-05 56 {
f27bb139c387680 Marc Zyngier 2012-03-05 57 regs->regs[0] = (long) error ? error : val;
f27bb139c387680 Marc Zyngier 2012-03-05 58 }
f27bb139c387680 Marc Zyngier 2012-03-05 59
f27bb139c387680 Marc Zyngier 2012-03-05 60 #define SYSCALL_MAX_ARGS 6
f27bb139c387680 Marc Zyngier 2012-03-05 61
f27bb139c387680 Marc Zyngier 2012-03-05 62 static inline void syscall_get_arguments(struct task_struct *task,
f27bb139c387680 Marc Zyngier 2012-03-05 63 struct pt_regs *regs,
f27bb139c387680 Marc Zyngier 2012-03-05 64 unsigned int i, unsigned int n,
f27bb139c387680 Marc Zyngier 2012-03-05 65 unsigned long *args)
f27bb139c387680 Marc Zyngier 2012-03-05 66 {
7b22c03536a5391 AKASHI Takahiro 2013-10-03 67 if (n == 0)
7b22c03536a5391 AKASHI Takahiro 2013-10-03 68 return;
7b22c03536a5391 AKASHI Takahiro 2013-10-03 69
f27bb139c387680 Marc Zyngier 2012-03-05 70 if (i + n > SYSCALL_MAX_ARGS) {
f27bb139c387680 Marc Zyngier 2012-03-05 71 unsigned long *args_bad = args + SYSCALL_MAX_ARGS - i;
f27bb139c387680 Marc Zyngier 2012-03-05 72 unsigned int n_bad = n + i - SYSCALL_MAX_ARGS;
f27bb139c387680 Marc Zyngier 2012-03-05 @73 pr_warning("%s called with max args %d, handling only %d\n",
f27bb139c387680 Marc Zyngier 2012-03-05 74 __func__, i + n, SYSCALL_MAX_ARGS);
f27bb139c387680 Marc Zyngier 2012-03-05 @75 memset(args_bad, 0, n_bad * sizeof(args[0]));
f27bb139c387680 Marc Zyngier 2012-03-05 76 }
f27bb139c387680 Marc Zyngier 2012-03-05 77
f27bb139c387680 Marc Zyngier 2012-03-05 78 if (i == 0) {
f27bb139c387680 Marc Zyngier 2012-03-05 79 args[0] = regs->orig_x0;
f27bb139c387680 Marc Zyngier 2012-03-05 80 args++;
f27bb139c387680 Marc Zyngier 2012-03-05 81 i++;
f27bb139c387680 Marc Zyngier 2012-03-05 82 n--;
f27bb139c387680 Marc Zyngier 2012-03-05 83 }
f27bb139c387680 Marc Zyngier 2012-03-05 84
f27bb139c387680 Marc Zyngier 2012-03-05 @85 memcpy(args, ®s->regs[i], n * sizeof(args[0]));
f27bb139c387680 Marc Zyngier 2012-03-05 86 }
f27bb139c387680 Marc Zyngier 2012-03-05 87
:::::: The code at line 30 was first introduced by commit
:::::: f27bb139c3876806a2c82e979d2dbbece44c66df arm64: Miscellaneous library functions
:::::: TO: Marc Zyngier <marc.zyngier@....com>
:::::: CC: Catalin Marinas <catalin.marinas@....com>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (109280 bytes)
Powered by blists - more mailing lists