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 A538EC7618D for ; Thu, 6 Apr 2023 04:20:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 856D86B0071; Thu, 6 Apr 2023 00:20:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 806D56B0074; Thu, 6 Apr 2023 00:20:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6F6F66B0075; Thu, 6 Apr 2023 00:20:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 5C71D6B0071 for ; Thu, 6 Apr 2023 00:20:48 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 277B11411AC for ; Thu, 6 Apr 2023 04:20:48 +0000 (UTC) X-FDA: 80649665376.10.8F6249C Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by imf13.hostedemail.com (Postfix) with ESMTP id EBA302000F for ; Thu, 6 Apr 2023 04:20:45 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=JOb9Gg+t; spf=pass (imf13.hostedemail.com: domain of lkp@intel.com designates 192.55.52.88 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=1680754846; 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=rh92IVi9R9FGNf2K1By7Rd/4q4fuFKC8yNCGMfS9Tjs=; b=Z0hUyJltKJ8ExfbjqsOCMp1IU0iT20ckCQJOshegqknhI6gPRDjey/kMJ/qql2HRhki4vg zPICtR4kOo/pj9F5mpHSFp871MHJko4O9I27VUUoXpCQPMh/aoAzvxbqrjrznC/GFBC/RX +16ps3uVWOr6isIdT7BSf4uMRdrGncc= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=JOb9Gg+t; spf=pass (imf13.hostedemail.com: domain of lkp@intel.com designates 192.55.52.88 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=1680754846; a=rsa-sha256; cv=none; b=qhr7tvQh2m2mQfG2xxhOAGAfbmTgJq/iL6GKbo+xIP8QhvEEmF2uputfmHHMWrlUHI0g7D Bg2HDSlnjEVv1QzULeifgm9le4eDVg6iNT8lY02fh2u8vji2hUAgJpFQNMWF4dzI+XFFA0 XbM2bmz42bD30MmMRiPCFMm9OyQtpVQ= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680754846; x=1712290846; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=wKEFDQF1XVPPVHZwUg8G4bWa/HEfSKPyND1ksY/zx+o=; b=JOb9Gg+tYS/K2h4ySQ2tVO2bKPxhZy49Qn496gvWkBnITnp35FFsS0u+ NmYXVVBNAd/TxuUmB/+Pg35vRTf6U5Fr5Cr2OUp/yeNth2UXdyPtErXSV 7fd3S+vTa3+PuPxTEE9zWEl8iZDrrI2cFvLI8BHn6FOVOCYDGwnSW0whU vdoPegBk9b2N79P2iR16ISHh2H9VZ00dNimR15Pps9gy2f5xHoU0E4q2E wdiKLWyPQcGVTK+JYMSNexY9jEUKUabyr8FNYzAzZ3VXCnrShx1qpIdr6 5BDJ9BCDr74x1L9H5nFGyAcFvDgDn9Jrt2U/ReLR81IR0mhoH1QNBH+zJ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10671"; a="370470314" X-IronPort-AV: E=Sophos;i="5.98,322,1673942400"; d="scan'208";a="370470314" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2023 21:20:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10671"; a="830607147" X-IronPort-AV: E=Sophos;i="5.98,322,1673942400"; d="scan'208";a="830607147" Received: from lkp-server01.sh.intel.com (HELO b613635ddfff) ([10.239.97.150]) by fmsmga001.fm.intel.com with ESMTP; 05 Apr 2023 21:20:36 -0700 Received: from kbuild by b613635ddfff with local (Exim 4.96) (envelope-from ) id 1pkH6y-000R2c-0l; Thu, 06 Apr 2023 04:20:36 +0000 Date: Thu, 6 Apr 2023 12:19:46 +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 , 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 3/9] string: Add Kunit tests for strcat() family Message-ID: <202304061243.Bx5SK1xq-lkp@intel.com> References: <20230406000212.3442647-3-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230406000212.3442647-3-keescook@chromium.org> X-Rspamd-Queue-Id: EBA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S 8Uw0191WfYhE7LtDCpnO/7f9FUNzEUw0HGH/lk5QOd5bNtytGJkvXGsNTfxWpPbk86bwvgNpVMuQzy0cbreDiKrLn4H/y01hNAsPuEbGIELiN2dTcySNsWA9jBzRhGLE+SirVt068P5xMRmEmivaiYp+1iR3HkJRRj9l1CaKKUMTiNBfODvooKlEA1pG32DhBKmFHcrSJkUEiOQgBgqU1XS23zWaUC6nJnGWvTd/RYNte6ZwnjuZkUeXa/pyRuX8eOjlmIoI48R5NDl8H34t/26Ogk5UOROddd/huW1+Wikfnrj1zofi2vWuIOd60pxtko2nJ7s1fUTORIes8OqC2VciyWBCt6Ir8j1tH7W/oR+SqLT4bonyLGTW5sW0tMdWTxCIef2qK9xPziDMsMB7BUqDbZx26bWW778u4u+ohb/EZl97bDJEqpn0Meu+4zOZsKqnw5QfKJBH38eZM32W3gOhDjyf19WDb7pQetQsTG1fqkZmS68Kr6S2GYJP7TcbtFRKqO1xz689ZgXpDWEeclC8cxMyfi7EnU8OMfaTLeXuznNowELGILa8wG+ySQ8euq20IGT2XwbEqXGjDol80ADf2JuuWzhM8P0YSu+k+1gFAFk69HhH4ECux0O7+kKiKawaxMOmR/D2aVe6o84xMptBvJVE8XKoCReLpr1QgGnqHdcE= 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-20230405] [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-3-keescook%40chromium.org patch subject: [PATCH 3/9] string: Add Kunit tests for strcat() family config: riscv-randconfig-r042-20230403 (https://download.01.org/0day-ci/archive/20230406/202304061243.Bx5SK1xq-lkp@intel.com/config) compiler: riscv64-linux-gcc (GCC) 12.1.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/intel-lab-lkp/linux/commit/1cdc1d7eeb09497f84367bfc2919d5fcc380e454 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 1cdc1d7eeb09497f84367bfc2919d5fcc380e454 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=riscv olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=riscv 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/202304061243.Bx5SK1xq-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from include/linux/err.h:5, from include/kunit/assert.h:12, from include/kunit/test.h:12, from lib/strcat_kunit.c:8: lib/strcat_kunit.c: In function 'strncat_test': >> lib/strcat_kunit.c:52:33: warning: 'strncat' output truncated copying 2 bytes from a string of length 4 [-Wstringop-truncation] 52 | KUNIT_EXPECT_TRUE(test, strncat(dest, "ABCD", 2) == dest); | ^~~~~~~~~~~~~~~~~~~~~~~~ include/linux/compiler.h:77:45: note: in definition of macro 'likely' 77 | # define likely(x) __builtin_expect(!!(x), 1) | ^ include/kunit/test.h:545:9: note: in expansion of macro 'KUNIT_UNARY_ASSERTION' 545 | KUNIT_UNARY_ASSERTION(test, \ | ^~~~~~~~~~~~~~~~~~~~~ include/kunit/test.h:736:9: note: in expansion of macro 'KUNIT_TRUE_MSG_ASSERTION' 736 | KUNIT_TRUE_MSG_ASSERTION(test, \ | ^~~~~~~~~~~~~~~~~~~~~~~~ include/kunit/test.h:733:9: note: in expansion of macro 'KUNIT_EXPECT_TRUE_MSG' 733 | KUNIT_EXPECT_TRUE_MSG(test, condition, NULL) | ^~~~~~~~~~~~~~~~~~~~~ lib/strcat_kunit.c:52:9: note: in expansion of macro 'KUNIT_EXPECT_TRUE' 52 | KUNIT_EXPECT_TRUE(test, strncat(dest, "ABCD", 2) == dest); | ^~~~~~~~~~~~~~~~~ vim +/strncat +52 lib/strcat_kunit.c 29 30 static void strncat_test(struct kunit *test) 31 { 32 char dest[8]; 33 34 /* Destination is terminated. */ 35 memset(dest, 0, sizeof(dest)); 36 KUNIT_EXPECT_EQ(test, strlen(dest), 0); 37 /* Empty copy of size 0 does nothing. */ 38 KUNIT_EXPECT_TRUE(test, strncat(dest, "", 0) == dest); 39 KUNIT_EXPECT_STREQ(test, dest, ""); 40 /* Empty copy of size 1 does nothing too. */ 41 KUNIT_EXPECT_TRUE(test, strncat(dest, "", 1) == dest); 42 KUNIT_EXPECT_STREQ(test, dest, ""); 43 /* Copy of max 0 characters should do nothing. */ 44 KUNIT_EXPECT_TRUE(test, strncat(dest, "asdf", 0) == dest); 45 KUNIT_EXPECT_STREQ(test, dest, ""); 46 47 /* 4 characters copied in, even if max is 8. */ 48 KUNIT_EXPECT_TRUE(test, strncat(dest, "four\000123", 8) == dest); 49 KUNIT_EXPECT_STREQ(test, dest, "four"); 50 KUNIT_EXPECT_EQ(test, dest[5], '\0'); 51 /* 2 characters copied in okay, 2 ignored. */ > 52 KUNIT_EXPECT_TRUE(test, strncat(dest, "ABCD", 2) == dest); 53 KUNIT_EXPECT_STREQ(test, dest, "fourAB"); 54 } 55 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests