tree: https://github.com/ammarfaizi2/linux-block google/android/kernel/common/deprecated/android-4.14-p-release head: 0ca5d5ac9152d01b3494fb2efb5390319eb9904a commit: 2b02b4ab89b9cba5aec936046d8538962c5142fc [137/6167] ANDROID: net: paranoid: commoncap: Begin to warn users of implicit PARANOID_NETWORK capability grants config: x86_64-randconfig-a014 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://github.com/ammarfaizi2/linux-block/commit/2b02b4ab89b9cba5aec936046d8538962c5142fc git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block git fetch --no-tags ammarfaizi2-block google/android/kernel/common/deprecated/android-4.14-p-release git checkout 2b02b4ab89b9cba5aec936046d8538962c5142fc # 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 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash LDFLAGS=-z max-page-size=0x200000 If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All warnings (new ones prefixed by >>): >> security/commoncap.c:75:5: warning: no previous prototype for function '__cap_capable' [-Wmissing-prototypes] int __cap_capable(const struct cred *cred, struct user_namespace *targ_ns, ^ security/commoncap.c:75:1: note: declare 'static' if the function is not intended to be used outside of this translation unit int __cap_capable(const struct cred *cred, struct user_namespace *targ_ns, ^ static 1 warning generated. vim +/__cap_capable +75 security/commoncap.c 59 60 /** 61 * __cap_capable - Determine whether a task has a particular effective capability 62 * @cred: The credentials to use 63 * @ns: The user namespace in which we need the capability 64 * @cap: The capability to check for 65 * @audit: Whether to write an audit message or not 66 * 67 * Determine whether the nominated task has the specified capability amongst 68 * its effective set, returning 0 if it does, -ve if it does not. 69 * 70 * NOTE WELL: cap_has_capability() cannot be used like the kernel's capable() 71 * and has_capability() functions. That is, it has the reverse semantics: 72 * cap_has_capability() returns 0 when a task has a capability, but the 73 * kernel's capable() and has_capability() returns 1 for this case. 74 */ > 75 int __cap_capable(const struct cred *cred, struct user_namespace *targ_ns, 76 int cap, int audit) 77 { 78 struct user_namespace *ns = targ_ns; 79 80 /* See if cred has the capability in the target user namespace 81 * by examining the target user namespace and all of the target 82 * user namespace's parents. 83 */ 84 for (;;) { 85 /* Do we have the necessary capabilities? */ 86 if (ns == cred->user_ns) 87 return cap_raised(cred->cap_effective, cap) ? 0 : -EPERM; 88 89 /* 90 * If we're already at a lower level than we're looking for, 91 * we're done searching. 92 */ 93 if (ns->level <= cred->user_ns->level) 94 return -EPERM; 95 96 /* 97 * The owner of the user namespace in the parent of the 98 * user namespace has all caps. 99 */ 100 if ((ns->parent == cred->user_ns) && uid_eq(ns->owner, cred->euid)) 101 return 0; 102 103 /* 104 * If you have a capability in a parent user ns, then you have 105 * it over all children user namespaces as well. 106 */ 107 ns = ns->parent; 108 } 109 110 /* We never get here */ 111 } 112 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests