From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============3321052205619796250==" MIME-Version: 1.0 From: kernel test robot Subject: Re: [PATCH 1/3] [v3] Kbuild: move to -std=gnu11 Date: Thu, 10 Mar 2022 09:27:52 +0800 Message-ID: <202203100924.EykibAkU-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============3321052205619796250== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: llvm(a)lists.linux.dev CC: kbuild-all(a)lists.01.org BCC: lkp(a)intel.com In-Reply-To: <20220301145233.3689119-1-arnd@kernel.org> References: <20220301145233.3689119-1-arnd@kernel.org> TO: Arnd Bergmann Hi Arnd, I love your patch! Perhaps something to improve: [auto build test WARNING on arm64/for-next/core] [also build test WARNING on masahiroy-kbuild/for-next drm-intel/for-linux-n= ext staging/staging-testing kdave/for-next soc/for-next linus/master v5.17-= rc7 next-20220308] [cannot apply to srcres258-doc/doc-zh-tw] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Arnd-Bergmann/Kbuild-move-= to-std-gnu11/20220301-225348 base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for= -next/core :::::: branch date: 8 days ago :::::: commit date: 8 days ago config: x86_64-randconfig-c007 (https://download.01.org/0day-ci/archive/202= 20310/202203100924.EykibAkU-lkp(a)intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project d271fc= 04d5b97b12e6b797c6067d3c96a8d7470e) reproduce (this is a W=3D1 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/0day-ci/linux/commit/afebabb39f6a871f6e6d69f60= 1738fbce1c1b37c git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Arnd-Bergmann/Kbuild-move-to-std-g= nu11/20220301-225348 git checkout afebabb39f6a871f6e6d69f601738fbce1c1b37c # save the config file to linux build tree COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dclang make.cross ARCH= =3Dx86_64 clang-analyzer = If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot clang-analyzer warnings: (new ones prefixed by >>) ^ include/linux/list.h:75:2: note: Left side of '||' is false WRITE_ONCE(prev->next, new); ^ include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE' compiletime_assert_rwonce_type(x); \ ^ include/asm-generic/rwonce.h:36:21: note: expanded from macro 'compileti= me_assert_rwonce_type' compiletime_assert(__native_word(t) || sizeof(t) =3D=3D sizeof(l= ong long), \ ^ include/linux/compiler_types.h:313:3: note: expanded from macro '__nativ= e_word' (sizeof(t) =3D=3D sizeof(char) || sizeof(t) =3D=3D sizeof(short)= || \ ^ include/linux/list.h:75:2: note: Left side of '||' is false WRITE_ONCE(prev->next, new); ^ include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE' compiletime_assert_rwonce_type(x); \ ^ include/asm-generic/rwonce.h:36:21: note: expanded from macro 'compileti= me_assert_rwonce_type' compiletime_assert(__native_word(t) || sizeof(t) =3D=3D sizeof(l= ong long), \ ^ include/linux/compiler_types.h:313:3: note: expanded from macro '__nativ= e_word' (sizeof(t) =3D=3D sizeof(char) || sizeof(t) =3D=3D sizeof(short)= || \ ^ include/linux/list.h:75:2: note: Left side of '||' is false WRITE_ONCE(prev->next, new); ^ include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE' compiletime_assert_rwonce_type(x); \ ^ include/asm-generic/rwonce.h:36:21: note: expanded from macro 'compileti= me_assert_rwonce_type' compiletime_assert(__native_word(t) || sizeof(t) =3D=3D sizeof(l= ong long), \ ^ include/linux/compiler_types.h:313:3: note: expanded from macro '__nativ= e_word' (sizeof(t) =3D=3D sizeof(char) || sizeof(t) =3D=3D sizeof(short)= || \ ^ include/linux/list.h:75:2: note: Left side of '||' is true WRITE_ONCE(prev->next, new); ^ include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE' compiletime_assert_rwonce_type(x); \ ^ include/asm-generic/rwonce.h:36:38: note: expanded from macro 'compileti= me_assert_rwonce_type' compiletime_assert(__native_word(t) || sizeof(t) =3D=3D sizeof(l= ong long), \ ^ include/linux/list.h:75:2: note: Taking false branch WRITE_ONCE(prev->next, new); ^ include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE' compiletime_assert_rwonce_type(x); \ ^ include/asm-generic/rwonce.h:36:2: note: expanded from macro 'compiletim= e_assert_rwonce_type' compiletime_assert(__native_word(t) || sizeof(t) =3D=3D sizeof(l= ong long), \ ^ include/linux/compiler_types.h:346:2: note: expanded from macro 'compile= time_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COU= NTER__) ^ include/linux/compiler_types.h:334:2: note: expanded from macro '_compil= etime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:326:3: note: expanded from macro '__compi= letime_assert' if (!(condition)) \ ^ include/linux/list.h:75:2: note: Loop condition is false. Exiting loop WRITE_ONCE(prev->next, new); ^ include/asm-generic/rwonce.h:60:2: note: expanded from macro 'WRITE_ONCE' compiletime_assert_rwonce_type(x); \ ^ include/asm-generic/rwonce.h:36:2: note: expanded from macro 'compiletim= e_assert_rwonce_type' compiletime_assert(__native_word(t) || sizeof(t) =3D=3D sizeof(l= ong long), \ ^ include/linux/compiler_types.h:346:2: note: expanded from macro 'compile= time_assert' _compiletime_assert(condition, msg, __compiletime_assert_, __COU= NTER__) ^ include/linux/compiler_types.h:334:2: note: expanded from macro '_compil= etime_assert' __compiletime_assert(condition, msg, prefix, suffix) ^ include/linux/compiler_types.h:318:2: note: expanded from macro '__compi= letime_assert' do { \ ^ include/linux/list.h:75:2: note: Dereference of null pointer WRITE_ONCE(prev->next, new); ^ include/asm-generic/rwonce.h:61:2: note: expanded from macro 'WRITE_ONCE' __WRITE_ONCE(x, val); \ ^~~~~~~~~~~~~~~~~~~~ include/asm-generic/rwonce.h:55:30: note: expanded from macro '__WRITE_O= NCE' *(volatile typeof(x) *)&(x) =3D (val); = \ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ Suppressed 20 warnings (20 in non-user code). Use -header-filter=3D.* to display errors from all non-system headers. U= se -system-headers to display errors from system headers as well. 31 warnings generated. arch/x86/kernel/unwind_orc.c:38:7: warning: Value stored to 'mid' during= its initialization is never read [clang-analyzer-deadcode.DeadStores] int *mid =3D first, *found =3D first; ^~~ ~~~~~ arch/x86/kernel/unwind_orc.c:38:7: note: Value stored to 'mid' during it= s initialization is never read int *mid =3D first, *found =3D first; ^~~ ~~~~~ >> arch/x86/kernel/unwind_orc.c:640:2: warning: Call to function 'memset' i= s insecure as it does not provide security checks introduced in the C11 sta= ndard. Replace with analogous functions that support length arguments or pr= ovides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-se= curity.insecureAPI.DeprecatedOrUnsafeBufferHandling] memset(state, 0, sizeof(*state)); ^~~~~~ arch/x86/kernel/unwind_orc.c:640:2: note: Call to function 'memset' is i= nsecure as it does not provide security checks introduced in the C11 standa= rd. Replace with analogous functions that support length arguments or provi= des boundary checks such as 'memset_s' in case of C11 memset(state, 0, sizeof(*state)); ^~~~~~ Suppressed 29 warnings (29 in non-user code). Use -header-filter=3D.* to display errors from all non-system headers. U= se -system-headers to display errors from system headers as well. 29 warnings generated. Suppressed 29 warnings (29 in non-user code). Use -header-filter=3D.* to display errors from all non-system headers. U= se -system-headers to display errors from system headers as well. 9 warnings generated. Suppressed 9 warnings (9 in non-user code). Use -header-filter=3D.* to display errors from all non-system headers. U= se -system-headers to display errors from system headers as well. 6 warnings generated. Suppressed 6 warnings (6 in non-user code). Use -header-filter=3D.* to display errors from all non-system headers. U= se -system-headers to display errors from system headers as well. 38 warnings generated. Suppressed 38 warnings (38 in non-user code). Use -header-filter=3D.* to display errors from all non-system headers. U= se -system-headers to display errors from system headers as well. 53 warnings generated. arch/x86/events/core.c:812:2: warning: Call to function 'memset' is inse= cure as it does not provide security checks introduced in the C11 standard.= Replace with analogous functions that support length arguments or provides= boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security= .insecureAPI.DeprecatedOrUnsafeBufferHandling] memset(sched, 0, sizeof(*sched)); ^~~~~~ arch/x86/events/core.c:812:2: note: Call to function 'memset' is insecur= e as it does not provide security checks introduced in the C11 standard. Re= place with analogous functions that support length arguments or provides bo= undary checks such as 'memset_s' in case of C11 memset(sched, 0, sizeof(*sched)); ^~~~~~ arch/x86/events/core.c:1482:2: warning: Call to function 'memcpy' is ins= ecure as it does not provide security checks introduced in the C11 standard= . Replace with analogous functions that support length arguments or provide= s boundary checks such as 'memcpy_s' in case of C11 [clang-analyzer-securit= y.insecureAPI.DeprecatedOrUnsafeBufferHandling] memcpy(cpuc->assign, assign, n*sizeof(int)); ^~~~~~ arch/x86/events/core.c:1482:2: note: Call to function 'memcpy' is insecu= re as it does not provide security checks introduced in the C11 standard. R= eplace with analogous functions that support length arguments or provides b= oundary checks such as 'memcpy_s' in case of C11 memcpy(cpuc->assign, assign, n*sizeof(int)); ^~~~~~ arch/x86/events/core.c:1840:10: warning: Call to function 'sprintf' is i= nsecure as it does not provide bounding of the memory buffer or security ch= ecks introduced in the C11 standard. Replace with analogous functions that = support length arguments or provides boundary checks such as 'sprintf_s' in= case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferH= andling] return sprintf(page, "%s", pmu_attr->event_str); ^~~~~~~ arch/x86/events/core.c:1840:10: note: Call to function 'sprintf' is inse= cure as it does not provide bounding of the memory buffer or security check= s introduced in the C11 standard. Replace with analogous functions that sup= port length arguments or provides boundary checks such as 'sprintf_s' in ca= se of C11 return sprintf(page, "%s", pmu_attr->event_str); ^~~~~~~ arch/x86/events/core.c:1863:9: warning: Call to function 'sprintf' is in= secure as it does not provide bounding of the memory buffer or security che= cks introduced in the C11 standard. Replace with analogous functions that s= upport length arguments or provides boundary checks such as 'sprintf_s' in = case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHa= ndling] return sprintf(page, "%s", ^~~~~~~ arch/x86/events/core.c:1863:9: note: Call to function 'sprintf' is insec= ure as it does not provide bounding of the memory buffer or security checks= introduced in the C11 standard. Replace with analogous functions that supp= ort length arguments or provides boundary checks such as 'sprintf_s' in cas= e of C11 return sprintf(page, "%s", ^~~~~~~ arch/x86/events/core.c:1880:10: warning: Call to function 'sprintf' is i= nsecure as it does not provide bounding of the memory buffer or security ch= ecks introduced in the C11 standard. Replace with analogous functions that = support length arguments or provides boundary checks such as 'sprintf_s' in= case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferH= andling] return sprintf(page, "%s", pmu_attr->event_str); ^~~~~~~ arch/x86/events/core.c:1880:10: note: Call to function 'sprintf' is inse= cure as it does not provide bounding of the memory buffer or security check= s introduced in the C11 standard. Replace with analogous functions that sup= port length arguments or provides boundary checks such as 'sprintf_s' in ca= se of C11 return sprintf(page, "%s", pmu_attr->event_str); ^~~~~~~ arch/x86/events/core.c:1900:12: warning: Call to function 'snprintf' is = insecure as it does not provide security checks introduced in the C11 stand= ard. Replace with analogous functions that support length arguments or prov= ides boundary checks such as 'snprintf_s' in case of C11 [clang-analyzer-se= curity.insecureAPI.DeprecatedOrUnsafeBufferHandling] return snprintf(page, next_str - str + 1= , "%s", str); ^~~~~~~~ arch/x86/events/core.c:1900:12: note: Call to function 'snprintf' is ins= ecure as it does not provide security checks introduced in the C11 standard= . Replace with analogous functions that support length arguments or provide= s boundary checks such as 'snprintf_s' in case of C11 return snprintf(page, next_str - str + 1= , "%s", str); ^~~~~~~~ arch/x86/events/core.c:1902:12: warning: Call to function 'sprintf' is i= nsecure as it does not provide bounding of the memory buffer or security ch= ecks introduced in the C11 standard. Replace with analogous functions that = support length arguments or provides boundary checks such as 'sprintf_s' in= case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferH= andling] return sprintf(page, "%s", str); ^~~~~~~ arch/x86/events/core.c:1902:12: note: Call to function 'sprintf' is inse= cure as it does not provide bounding of the memory buffer or security check= s introduced in the C11 standard. Replace with analogous functions that sup= port length arguments or provides boundary checks such as 'sprintf_s' in ca= se of C11 return sprintf(page, "%s", str); ^~~~~~~ arch/x86/events/core.c:1976:8: warning: Call to function 'sprintf' is in= secure as it does not provide security checks introduced in the C11 standar= d. Replace with analogous functions that support length arguments or provid= es boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-secur= ity.insecureAPI.DeprecatedOrUnsafeBufferHandling] ret =3D sprintf(page, "event=3D0x%02llx", event); ^~~~~~~ arch/x86/events/core.c:1976:8: note: Call to function 'sprintf' is insec= ure as it does not provide security checks introduced in the C11 standard. = Replace with analogous functions that support length arguments or provides = boundary checks such as 'sprintf_s' in case of C11 ret =3D sprintf(page, "event=3D0x%02llx", event); ^~~~~~~ arch/x86/events/core.c:1979:10: warning: Call to function 'sprintf' is i= nsecure as it does not provide security checks introduced in the C11 standa= rd. Replace with analogous functions that support length arguments or provi= des boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-secu= rity.insecureAPI.DeprecatedOrUnsafeBufferHandling] ret +=3D sprintf(page + ret, ",umask=3D0x%02llx", umask); ^~~~~~~ arch/x86/events/core.c:1979:10: note: Call to function 'sprintf' is inse= cure as it does not provide security checks introduced in the C11 standard.= Replace with analogous functions that support length arguments or provides= boundary checks such as 'sprintf_s' in case of C11 ret +=3D sprintf(page + ret, ",umask=3D0x%02llx", umask); ^~~~~~~ arch/x86/events/core.c:1982:10: warning: Call to function 'sprintf' is i= nsecure as it does not provide security checks introduced in the C11 standa= rd. Replace with analogous functions that support length arguments or provi= des boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-secu= rity.insecureAPI.DeprecatedOrUnsafeBufferHandling] ret +=3D sprintf(page + ret, ",edge"); ^~~~~~~ arch/x86/events/core.c:1982:10: note: Call to function 'sprintf' is inse= cure as it does not provide security checks introduced in the C11 standard.= Replace with analogous functions that support length arguments or provides= boundary checks such as 'sprintf_s' in case of C11 ret +=3D sprintf(page + ret, ",edge"); ^~~~~~~ arch/x86/events/core.c:1985:10: warning: Call to function 'sprintf' is i= nsecure as it does not provide security checks introduced in the C11 standa= rd. Replace with analogous functions that support length arguments or provi= des boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-secu= rity.insecureAPI.DeprecatedOrUnsafeBufferHandling] ret +=3D sprintf(page + ret, ",pc"); ^~~~~~~ arch/x86/events/core.c:1985:10: note: Call to function 'sprintf' is inse= cure as it does not provide security checks introduced in the C11 standard.= Replace with analogous functions that support length arguments or provides= boundary checks such as 'sprintf_s' in case of C11 ret +=3D sprintf(page + ret, ",pc"); ^~~~~~~ arch/x86/events/core.c:1988:10: warning: Call to function 'sprintf' is i= nsecure as it does not provide security checks introduced in the C11 standa= rd. Replace with analogous functions that support length arguments or provi= des boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-secu= rity.insecureAPI.DeprecatedOrUnsafeBufferHandling] ret +=3D sprintf(page + ret, ",any"); ^~~~~~~ arch/x86/events/core.c:1988:10: note: Call to function 'sprintf' is inse= cure as it does not provide security checks introduced in the C11 standard.= Replace with analogous functions that support length arguments or provides= boundary checks such as 'sprintf_s' in case of C11 ret +=3D sprintf(page + ret, ",any"); ^~~~~~~ arch/x86/events/core.c:1991:10: warning: Call to function 'sprintf' is i= nsecure as it does not provide security checks introduced in the C11 standa= rd. Replace with analogous functions that support length arguments or provi= des boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-secu= rity.insecureAPI.DeprecatedOrUnsafeBufferHandling] ret +=3D sprintf(page + ret, ",inv"); ^~~~~~~ arch/x86/events/core.c:1991:10: note: Call to function 'sprintf' is inse= cure as it does not provide security checks introduced in the C11 standard.= Replace with analogous functions that support length arguments or provides= boundary checks such as 'sprintf_s' in case of C11 ret +=3D sprintf(page + ret, ",inv"); ^~~~~~~ arch/x86/events/core.c:1994:10: warning: Call to function 'sprintf' is i= nsecure as it does not provide security checks introduced in the C11 standa= rd. Replace with analogous functions that support length arguments or provi= des boundary checks such as 'sprintf_s' in case of C11 [clang-analyzer-secu= rity.insecureAPI.DeprecatedOrUnsafeBufferHandling] ret +=3D sprintf(page + ret, ",cmask=3D0x%02llx", cmask); vim +640 arch/x86/kernel/unwind_orc.c ee9f8fce996408 Josh Poimboeuf 2017-07-24 636 = ee9f8fce996408 Josh Poimboeuf 2017-07-24 637 void __unwind_start(struct u= nwind_state *state, struct task_struct *task, ee9f8fce996408 Josh Poimboeuf 2017-07-24 638 struct pt_regs *regs, = unsigned long *first_frame) ee9f8fce996408 Josh Poimboeuf 2017-07-24 639 { ee9f8fce996408 Josh Poimboeuf 2017-07-24 @640 memset(state, 0, sizeof(*st= ate)); --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============3321052205619796250==--