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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6BD9C32793 for ; Sat, 20 Aug 2022 09:37:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245713AbiHTJhc (ORCPT ); Sat, 20 Aug 2022 05:37:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344268AbiHTJh2 (ORCPT ); Sat, 20 Aug 2022 05:37:28 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBD9721830 for ; Sat, 20 Aug 2022 02:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660988246; x=1692524246; h=date:from:to:cc:subject:message-id:mime-version; bh=yvfMGO3Laqkb5ogXPBKhcPOb0MtBZlpNEgy6edwzeZA=; b=Y/ZsnZyTjEhfsIHG7xZimPe1iVvJNz3xxkctMTNg1B/Hmf4tekgwqDrt Pbod3DN8bwrP/OPq469/Q0v9n9QiYg1EotzrwxP1AlDYMnhD8cVsnmrVC PYftiGHgkUOmmAishiD9ho1Zc2pNj6fya2B9ZWHvGV8RgUJEW3GbMDG9J XoZ9dDE+rNwq+bQSixlCc8S+eVgPXwhAQMgwi6Re55diAr4ihAvvbkgIB nmbjpKEiLiy2VX/lOCqGdqygHDv3fARNE/bwTKKnP0drtHx8h1UN2zxQt v1uU1gOyWvDOZMxSyk3u4zj97bEpNUuLDQ6GpkBzRXiVxKZzcdYPT1kTu g==; X-IronPort-AV: E=McAfee;i="6500,9779,10444"; a="293164756" X-IronPort-AV: E=Sophos;i="5.93,250,1654585200"; d="scan'208";a="293164756" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Aug 2022 02:37:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,250,1654585200"; d="scan'208";a="936480691" Received: from lkp-server01.sh.intel.com (HELO 44b6dac04a33) ([10.239.97.150]) by fmsmga005.fm.intel.com with ESMTP; 20 Aug 2022 02:37:25 -0700 Received: from kbuild by 44b6dac04a33 with local (Exim 4.96) (envelope-from ) id 1oPKuy-0002Rh-1r; Sat, 20 Aug 2022 09:37:24 +0000 Date: Sat, 20 Aug 2022 17:37:07 +0800 From: kernel test robot To: Dan Carpenter Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Chuck Lever Subject: [linux-stable-rc:linux-4.19.y 2019/3658] include/linux/sunrpc/xdr.h:512:17: error: comparison is always false due to limited range of data type Message-ID: <202208201701.arornb8Z-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dan, FYI, the error/warning still remains. tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y head: deac5288db671ab8cdd05be7ee0f0601c6692c6b commit: 3a2789e8ccb4a3e2a631f6817a2d3bb98b8c4fd8 [2019/3658] NFSD: prevent integer overflow on 32 bit systems config: sparc64-randconfig-s052-20220820 (https://download.01.org/0day-ci/archive/20220820/202208201701.arornb8Z-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-rc.git/commit/?id=3a2789e8ccb4a3e2a631f6817a2d3bb98b8c4fd8 git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git git fetch --no-tags linux-stable-rc linux-4.19.y git checkout 3a2789e8ccb4a3e2a631f6817a2d3bb98b8c4fd8 # 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 SHELL=/bin/bash arch/sparc/kernel/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot 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:512:17: error: comparison is always false due to limited range of data type [-Werror=type-limits] 512 | if (len > SIZE_MAX / sizeof(*p)) | ^ In file included from include/linux/ethtool.h:17, from include/linux/netdevice.h:41, from include/net/sock.h:51, from include/linux/tcp.h:23, from include/linux/ipv6.h:87, from include/net/ipv6.h:16, from include/linux/sunrpc/clnt.h:28, from include/linux/nfs_fs.h:32: include/linux/compat.h: In function 'put_compat_sigset': include/linux/compat.h:495:58: error: this statement may fall through [-Werror=implicit-fallthrough=] 495 | case 4: v.sig[7] = (set->sig[3] >> 32); v.sig[6] = set->sig[3]; | ~~~~~~~~~^~~~~~~~~~~~~ include/linux/compat.h:496:9: note: here 496 | case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2]; | ^~~~ include/linux/compat.h:496:58: error: this statement may fall through [-Werror=implicit-fallthrough=] 496 | case 3: v.sig[5] = (set->sig[2] >> 32); v.sig[4] = set->sig[2]; | ~~~~~~~~~^~~~~~~~~~~~~ include/linux/compat.h:497:9: note: here 497 | case 2: v.sig[3] = (set->sig[1] >> 32); v.sig[2] = set->sig[1]; | ^~~~ include/linux/compat.h:497:58: error: this statement may fall through [-Werror=implicit-fallthrough=] 497 | case 2: v.sig[3] = (set->sig[1] >> 32); v.sig[2] = set->sig[1]; | ~~~~~~~~~^~~~~~~~~~~~~ include/linux/compat.h:498:9: note: here 498 | case 1: v.sig[1] = (set->sig[0] >> 32); v.sig[0] = set->sig[0]; | ^~~~ cc1: all warnings being treated as errors vim +512 include/linux/sunrpc/xdr.h 490 491 /** 492 * xdr_stream_decode_uint32_array - Decode variable length array of integers 493 * @xdr: pointer to xdr_stream 494 * @array: location to store the integer array or NULL 495 * @array_size: number of elements to store 496 * 497 * Return values: 498 * On success, returns number of elements stored in @array 499 * %-EBADMSG on XDR buffer overflow 500 * %-EMSGSIZE if the size of the array exceeds @array_size 501 */ 502 static inline ssize_t 503 xdr_stream_decode_uint32_array(struct xdr_stream *xdr, 504 __u32 *array, size_t array_size) 505 { 506 __be32 *p; 507 __u32 len; 508 ssize_t retval; 509 510 if (unlikely(xdr_stream_decode_u32(xdr, &len) < 0)) 511 return -EBADMSG; > 512 if (len > SIZE_MAX / sizeof(*p)) 513 return -EBADMSG; 514 p = xdr_inline_decode(xdr, len * sizeof(*p)); 515 if (unlikely(!p)) 516 return -EBADMSG; 517 if (array == NULL) 518 return len; 519 if (len <= array_size) { 520 if (len < array_size) 521 memset(array+len, 0, (array_size-len)*sizeof(*array)); 522 array_size = len; 523 retval = len; 524 } else 525 retval = -EMSGSIZE; 526 for (; array_size > 0; p++, array++, array_size--) 527 *array = be32_to_cpup(p); 528 return retval; 529 } 530 #endif /* __KERNEL__ */ 531 -- 0-DAY CI Kernel Test Service https://01.org/lkp