From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D589C6FD1D for ; Fri, 7 Apr 2023 10:27:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 901F9900003; Fri, 7 Apr 2023 06:27:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8B0E7900002; Fri, 7 Apr 2023 06:27:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7A055900003; Fri, 7 Apr 2023 06:27:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 6D2ED900002 for ; Fri, 7 Apr 2023 06:27:54 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 2DC88C0251 for ; Fri, 7 Apr 2023 10:27:54 +0000 (UTC) X-FDA: 80654219268.09.8A126A8 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by imf16.hostedemail.com (Postfix) with ESMTP id 7FDC018000F for ; Fri, 7 Apr 2023 10:27:50 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=HOMbjNrw; spf=pass (imf16.hostedemail.com: domain of lkp@intel.com designates 134.134.136.24 as permitted sender) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1680863272; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=8bZCFxcYs+DO5ALqN0ERdh2WdVQsoAQw5hzk1GiqvJ0=; b=fNJizNa84kb2kn9Qg8MyD/Y1MgbaPjIhNg4NZxqDOO5OAgoavS85C4873N9qowN0XpIc2e US8u4s9Vk4fOaC0guVAvXoUAqyplZfBLTdVrpVfjph9cml4XmVwpMyW0HikTqd9rtlQTTk YKCVMINjAVvuORTKdAC7rKAd+q/yfHc= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=HOMbjNrw; spf=pass (imf16.hostedemail.com: domain of lkp@intel.com designates 134.134.136.24 as permitted sender) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1680863272; a=rsa-sha256; cv=none; b=jydtX2nDUTGAs/hWw4Ml7f/1nJXfl1bnSavq+B4R9lie8gdwRrLu0XghmMtwH93fpqIeIg HzBFVu7eT37s2ZFlkUFfpaTO+YW+X988bzNXq5oLdI2pGSw47u5uZhX9DlOp0EybRZttZI 8LYrloUD6vEuQ5ARb0jRYpg0WOol7G8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680863270; x=1712399270; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=7edVbc99053vvbrnLS4HCEABW1YsZFGYJKqGCy78KsM=; b=HOMbjNrwJiA3JFDk3tRMh/GT0ZLbUqS35eCXfpGSOnQv2xG0h22rbgs5 7KVIHvP5E9814DQ01F3rXmg1lmrjj5I/2+YVaY1oLNNAunEvsK7zTTABn +zkmXQoHe6iN1xckzBxsXL4ksaXjrQh8txSDwUKZsQp66bZXtL5/EC66M ZOOGNrniI7WREPbUmBOha2z6UwTylYHhMTizLqpcPwTUbPENXatgT+1le fnMVxJn/wDQUdWQ38suKkL0NOFIZNL7RREc+7QWTTPfhNi4VH9WV2pYsn O0FZIosLctLQ7ZgHlSAZUK9F1H0r76DcdYk//z0O4aWQ8R0EdP4CE8qu/ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10672"; a="344734402" X-IronPort-AV: E=Sophos;i="5.98,326,1673942400"; d="scan'208";a="344734402" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2023 03:27:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10672"; a="756679889" X-IronPort-AV: E=Sophos;i="5.98,326,1673942400"; d="scan'208";a="756679889" Received: from lkp-server01.sh.intel.com (HELO b613635ddfff) ([10.239.97.150]) by fmsmga004.fm.intel.com with ESMTP; 07 Apr 2023 03:27:40 -0700 Received: from kbuild by b613635ddfff with local (Exim 4.96) (envelope-from ) id 1pkjJj-000SNG-12; Fri, 07 Apr 2023 10:27:39 +0000 Date: Fri, 7 Apr 2023 18:26:51 +0800 From: kernel test robot To: Kees Cook , linux-hardening@vger.kernel.org Cc: oe-kbuild-all@lists.linux.dev, Kees Cook , Andy Shevchenko , Cezary Rojewski , Puyou Lu , Mark Brown , Josh Poimboeuf , Peter Zijlstra , Brendan Higgins , David Gow , Andrew Morton , Linux Memory Management List , Nathan Chancellor , Alexander Potapenko , Zhaoyang Huang , Randy Dunlap , Geert Uytterhoeven , Miguel Ojeda , Nick Desaulniers , Liam Howlett , Vlastimil Babka , Dan Williams , Rasmus Villemoes , Yury Norov , "Jason A. Donenfeld" , Sander Vanheule , Eric Biggers , "Masami Hiramatsu (Google)" , Andrey Konovalov , Linus Walleij Subject: Re: [PATCH 6/9] fortify: Split reporting and avoid passing string pointer Message-ID: <202304071824.648116sH-lkp@intel.com> References: <20230406000212.3442647-6-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230406000212.3442647-6-keescook@chromium.org> X-Rspamd-Server: rspam05 X-Rspamd-Que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nn3IuQSd8ZKIO92SxZekuAnvgTLZ6LZxyAQMRRpgtqHPCVeUBjufIiLxq/5AYJ4aaJfr3RH9giIS9Mgo8o0uxP0seBSPzCaMr65Wdd5rxzsw/cz5OiOlYOas6aTX8A5Nxpe9GDirsE9SzZequJbsS4WMZvkKisEEfASkdM4ZX7vEJtZbsOiqJ8rW3K0kPvlERFEvoG2AhUtLKmsJvgiJU/1tws/5gt0HPnxEzCKOisqmyBsMm1AAGKJqoMxw+BVeIuJZm64vNUfUXFVYfsUCP2SBidUUFy7tC+hbpcNyTd/9Cq8V/PsP+TJRXvsM4xU8Yr8JFl+dwZ+spNUzzLTFwf4jpo3SR+y3+Pn9rTtuJlrlPYiAtGNgSoq0k1kV3GBh/tKIqLoUvk7LWanHQwnroyMO4XNhwdVC4l+5cJUuVyMOmOUkZ+ZHQ8nOx5nDaZOKWuad2yA1EZ9DmLW0hZ/Jpm7MBBaIoRExHeTF9XTizSpXVib1bsMZctxi+toewLnAhfg/3Is875MjGHgVUQrXeaBLhZnyi3fS8b0scEvUzH6uTawhH/rRRWhu9Mm3YC9Hn8Nb6I7/6QZmyN9zg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Kees, kernel test robot noticed the following build warnings: [auto build test WARNING on kees/for-next/hardening] [also build test WARNING on kees/for-next/pstore kees/for-next/kspp akpm-mm/mm-everything linus/master v6.3-rc5 next-20230406] [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#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Kees-Cook/kunit-tool-Enable-CONFIG_FORTIFY_SOURCE-under-UML/20230406-081014 base: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening patch link: https://lore.kernel.org/r/20230406000212.3442647-6-keescook%40chromium.org patch subject: [PATCH 6/9] fortify: Split reporting and avoid passing string pointer config: arm64-randconfig-s053-20230406 (https://download.01.org/0day-ci/archive/20230407/202304071824.648116sH-lkp@intel.com/config) compiler: aarch64-linux-gcc (GCC) 12.1.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.4-39-gce1a6720-dirty # https://github.com/intel-lab-lkp/linux/commit/4fd520e6ee549e1ffe8859e26e57ea64b48e78ea git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Kees-Cook/kunit-tool-Enable-CONFIG_FORTIFY_SOURCE-under-UML/20230406-081014 git checkout 4fd520e6ee549e1ffe8859e26e57ea64b48e78ea # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Link: https://lore.kernel.org/oe-kbuild-all/202304071824.648116sH-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) lib/string_helpers.c:1030:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strncpy' lib/string_helpers.c:1033:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strnlen' lib/string_helpers.c:1036:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strlen' lib/string_helpers.c:1039:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strlcpy' lib/string_helpers.c:1042:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strscpy' lib/string_helpers.c:1045:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strlcat' lib/string_helpers.c:1048:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strcat' lib/string_helpers.c:1051:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strncat' lib/string_helpers.c:1054:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_memset' lib/string_helpers.c:1057:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_memcpy' lib/string_helpers.c:1060:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_memmove' lib/string_helpers.c:1063:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_memscan' lib/string_helpers.c:1066:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_memcmp' lib/string_helpers.c:1069:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_memchr' lib/string_helpers.c:1072:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_memchr_inv' lib/string_helpers.c:1075:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_kmemdup' lib/string_helpers.c:1078:14: sparse: sparse: undefined identifier 'FORTIFY_FUNC_strcpy' >> lib/string_helpers.c:1030:14: sparse: sparse: incompatible types for 'case' statement lib/string_helpers.c:1033:14: sparse: sparse: incompatible types for 'case' statement lib/string_helpers.c:1036:14: sparse: sparse: incompatible types for 'case' statement lib/string_helpers.c:1039:14: sparse: sparse: incompatible types for 'case' statement lib/string_helpers.c:1042:14: sparse: sparse: incompatible types for 'case' statement lib/string_helpers.c:1045:14: sparse: sparse: incompatible types for 'case' statement lib/string_helpers.c:1048:14: sparse: sparse: incompatible types for 'case' statement lib/string_helpers.c:1051:14: sparse: sparse: incompatible types for 'case' statement lib/string_helpers.c:1054:14: sparse: sparse: incompatible types for 'case' statement lib/string_helpers.c:1057:14: sparse: sparse: incompatible types for 'case' statement lib/string_helpers.c:1060:14: sparse: sparse: incompatible types for 'case' statement lib/string_helpers.c:1063:14: sparse: sparse: incompatible types for 'case' statement lib/string_helpers.c:1066:14: sparse: sparse: incompatible types for 'case' statement lib/string_helpers.c:1069:14: sparse: sparse: incompatible types for 'case' statement lib/string_helpers.c:1072:14: sparse: sparse: incompatible types for 'case' statement lib/string_helpers.c:1075:14: sparse: sparse: incompatible types for 'case' statement lib/string_helpers.c:1078:14: sparse: sparse: incompatible types for 'case' statement lib/string_helpers.c:1030:14: sparse: sparse: Expected constant expression in case statement lib/string_helpers.c:1033:14: sparse: sparse: Expected constant expression in case statement lib/string_helpers.c:1036:14: sparse: sparse: Expected constant expression in case statement lib/string_helpers.c:1039:14: sparse: sparse: Expected constant expression in case statement lib/string_helpers.c:1042:14: sparse: sparse: Expected constant expression in case statement lib/string_helpers.c:1045:14: sparse: sparse: Expected constant expression in case statement lib/string_helpers.c:1048:14: sparse: sparse: Expected constant expression in case statement lib/string_helpers.c:1051:14: sparse: sparse: Expected constant expression in case statement lib/string_helpers.c:1054:14: sparse: sparse: Expected constant expression in case statement lib/string_helpers.c:1057:14: sparse: sparse: Expected constant expression in case statement lib/string_helpers.c:1060:14: sparse: sparse: Expected constant expression in case statement lib/string_helpers.c:1063:14: sparse: sparse: Expected constant expression in case statement lib/string_helpers.c:1066:14: sparse: sparse: Expected constant expression in case statement lib/string_helpers.c:1069:14: sparse: sparse: Expected constant expression in case statement lib/string_helpers.c:1072:14: sparse: sparse: Expected constant expression in case statement lib/string_helpers.c:1075:14: sparse: sparse: Expected constant expression in case statement lib/string_helpers.c:1078:14: sparse: sparse: Expected constant expression in case statement vim +/case +1030 lib/string_helpers.c 1023 1024 void __fortify_report(u8 reason) 1025 { 1026 const char *name; 1027 const bool write = !!(reason & 0x1); 1028 1029 switch (reason >> 1) { > 1030 case FORTIFY_FUNC_strncpy: 1031 name = "strncpy"; 1032 break; 1033 case FORTIFY_FUNC_strnlen: 1034 name = "strnlen"; 1035 break; 1036 case FORTIFY_FUNC_strlen: 1037 name = "strlen"; 1038 break; 1039 case FORTIFY_FUNC_strlcpy: 1040 name = "strlcpy"; 1041 break; 1042 case FORTIFY_FUNC_strscpy: 1043 name = "strscpy"; 1044 break; 1045 case FORTIFY_FUNC_strlcat: 1046 name = "strlcat"; 1047 break; 1048 case FORTIFY_FUNC_strcat: 1049 name = "strcat"; 1050 break; 1051 case FORTIFY_FUNC_strncat: 1052 name = "strncat"; 1053 break; > 1054 case FORTIFY_FUNC_memset: 1055 name = "memset"; 1056 break; 1057 case FORTIFY_FUNC_memcpy: 1058 name = "memcpy"; 1059 break; 1060 case FORTIFY_FUNC_memmove: 1061 name = "memmove"; 1062 break; 1063 case FORTIFY_FUNC_memscan: 1064 name = "memscan"; 1065 break; 1066 case FORTIFY_FUNC_memcmp: 1067 name = "memcmp"; 1068 break; 1069 case FORTIFY_FUNC_memchr: 1070 name = "memchr"; 1071 break; 1072 case FORTIFY_FUNC_memchr_inv: 1073 name = "memchr_inv"; 1074 break; 1075 case FORTIFY_FUNC_kmemdup: 1076 name = "kmemdup"; 1077 break; 1078 case FORTIFY_FUNC_strcpy: 1079 name = "strcpy"; 1080 break; 1081 default: 1082 name = "unknown"; 1083 } 1084 WARN(1, "%s: detected buffer %s overflow\n", name, write ? "write" : "read"); 1085 } 1086 EXPORT_SYMBOL(__fortify_report); 1087 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests