From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7467C10E5 for ; Mon, 20 Mar 2023 05:34:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679290473; x=1710826473; h=date:from:to:cc:subject:message-id:mime-version; bh=ECisnEdJ/4pqY6rXO1LJlNu222EmEWljaL14/q+3dsg=; b=Up143pu+x9bvHJ6zkG4GwjsWuXgbE3lYWh2mf2oCeSGovobl8/fyKkMv Mf2p046VIM2L9U7GWGvN5hdouZcqxtS+SNAKvLkNA2oXmaUadbnG9s3sU 0IfHn+0iUhaOxJURCe8OhsayiKuWyHNKG1M/HyrT3dI5iPcbOr/Hdx7eY 4WbIrMUsziswpcr1ntkVH5ncM/zDAdA63Q5bg0dXtoMS+xbEkWiyMJRtu vlPEeV8TTa0gEobtW6J11WOHnUhwXbTrbHAa74D/NOi9/wT64vZWKTvGF f+mam5XnwujvpwOV3Z1f3RUrX/skNWEUYadXr5rL3Lw5/W7DZu5l7qJkD Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10654"; a="340937237" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="340937237" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2023 22:34:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10654"; a="745233110" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="745233110" Received: from lkp-server01.sh.intel.com (HELO b613635ddfff) ([10.239.97.150]) by fmsmga008.fm.intel.com with ESMTP; 19 Mar 2023 22:34:31 -0700 Received: from kbuild by b613635ddfff with local (Exim 4.96) (envelope-from ) id 1pe8AA-000AqU-21; Mon, 20 Mar 2023 05:34:30 +0000 Date: Mon, 20 Mar 2023 13:33:38 +0800 From: kernel test robot To: Dan Carpenter Cc: oe-kbuild-all@lists.linux.dev, Greg Kroah-Hartman , Chuck Lever Subject: [stable:linux-5.4.y 2861/7889] include/linux/sunrpc/xdr.h:539:17: error: comparison is always false due to limited range of data type Message-ID: <202303201349.7xtBUxac-lkp@intel.com> Precedence: bulk X-Mailing-List: oe-kbuild-all@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Dan, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.4.y head: e4b5c766f50525d84754cfdf0e4edef1db9622c0 commit: ce1aa09cc14ed625104acc2d487bd92b9a88efe2 [2861/7889] NFSD: prevent integer overflow on 32 bit systems config: sparc64-randconfig-s043-20230319 (https://download.01.org/0day-ci/archive/20230320/202303201349.7xtBUxac-lkp@intel.com/config) compiler: sparc64-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://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?id=ce1aa09cc14ed625104acc2d487bd92b9a88efe2 git remote add stable https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git git fetch --no-tags stable linux-5.4.y git checkout ce1aa09cc14ed625104acc2d487bd92b9a88efe2 # 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=sparc64 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=sparc64 SHELL=/bin/bash arch/sparc/kernel/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Link: https://lore.kernel.org/oe-kbuild-all/202303201349.7xtBUxac-lkp@intel.com/ All errors (new ones prefixed by >>): In file included from include/linux/sunrpc/sched.h:19, from include/linux/sunrpc/auth.h:15, from include/linux/nfs_fs.h:31, from arch/sparc/kernel/sys_sparc32.c:25: include/linux/sunrpc/xdr.h: In function 'xdr_stream_decode_uint32_array': >> include/linux/sunrpc/xdr.h:539:17: error: comparison is always false due to limited range of data type [-Werror=type-limits] 539 | if (len > SIZE_MAX / sizeof(*p)) | ^ cc1: all warnings being treated as errors Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for FRAME_POINTER Depends on [n]: DEBUG_KERNEL [=y] && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS [=n] || MCOUNT [=n] Selected by [y]: - LOCKDEP [=y] && DEBUG_KERNEL [=y] && LOCK_DEBUGGING_SUPPORT [=y] && !MIPS && !PPC && !ARM && !S390 && !MICROBLAZE && !ARC && !X86 vim +539 include/linux/sunrpc/xdr.h 517 518 /** 519 * xdr_stream_decode_uint32_array - Decode variable length array of integers 520 * @xdr: pointer to xdr_stream 521 * @array: location to store the integer array or NULL 522 * @array_size: number of elements to store 523 * 524 * Return values: 525 * On success, returns number of elements stored in @array 526 * %-EBADMSG on XDR buffer overflow 527 * %-EMSGSIZE if the size of the array exceeds @array_size 528 */ 529 static inline ssize_t 530 xdr_stream_decode_uint32_array(struct xdr_stream *xdr, 531 __u32 *array, size_t array_size) 532 { 533 __be32 *p; 534 __u32 len; 535 ssize_t retval; 536 537 if (unlikely(xdr_stream_decode_u32(xdr, &len) < 0)) 538 return -EBADMSG; > 539 if (len > SIZE_MAX / sizeof(*p)) 540 return -EBADMSG; 541 p = xdr_inline_decode(xdr, len * sizeof(*p)); 542 if (unlikely(!p)) 543 return -EBADMSG; 544 if (array == NULL) 545 return len; 546 if (len <= array_size) { 547 if (len < array_size) 548 memset(array+len, 0, (array_size-len)*sizeof(*array)); 549 array_size = len; 550 retval = len; 551 } else 552 retval = -EMSGSIZE; 553 for (; array_size > 0; p++, array++, array_size--) 554 *array = be32_to_cpup(p); 555 return retval; 556 } 557 #endif /* __KERNEL__ */ 558 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests