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 70F39C433EF for ; Tue, 7 Jun 2022 13:36:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244815AbiFGNgB (ORCPT ); Tue, 7 Jun 2022 09:36:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243690AbiFGNf6 (ORCPT ); Tue, 7 Jun 2022 09:35:58 -0400 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D0F8C5DAF for ; Tue, 7 Jun 2022 06:35:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654608957; x=1686144957; h=date:from:to:cc:subject:message-id:mime-version; bh=Nvg8CIUJOcZjjFSd7z2akikFB5g4IYvZL0pLwxBwyEU=; b=lIeIqOIc0mdi2S9ErpUBHmaTpVeZPxPLWN9+jCjUv6CTzpAeSU2igFEg SgEQvGAZXjFLdYO8K3WxzDrOrXKHTK+FIDyRB5hRaQMQDlU9n3mFYJVJW WjzUcq2O6XwG/9U5zFfV7aYa+qF3+hZn9fbxAz9kKsggRxU3UPSK/u6k+ uA2wqdAd7tJzHnF5nLI/Jndbu6XS5IAnbNxJad8jOrqoy6F/uvdThYKG+ sFXuO0YM8lv3Ns0Bryx0I4bCLFRxV76zO/zyJXyAtlUpjukyL/Md5abpz X2qL8K4ATHoSJXQnHRtz+qG+0U49xTuU4ei+kqoRQZX4nOOgydUs1iDHn w==; X-IronPort-AV: E=McAfee;i="6400,9594,10370"; a="256557831" X-IronPort-AV: E=Sophos;i="5.91,284,1647327600"; d="scan'208";a="256557831" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2022 06:35:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,284,1647327600"; d="scan'208";a="669973475" Received: from lkp-server01.sh.intel.com (HELO 60dabacc1df6) ([10.239.97.150]) by FMSMGA003.fm.intel.com with ESMTP; 07 Jun 2022 06:35:54 -0700 Received: from kbuild by 60dabacc1df6 with local (Exim 4.95) (envelope-from ) id 1nyZNC-000DgB-29; Tue, 07 Jun 2022 13:35:54 +0000 Date: Tue, 7 Jun 2022 21:35:15 +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-5.4.y 2861/3729] include/linux/sunrpc/xdr.h:539:17: error: comparison is always false due to limited range of data type Message-ID: <202206072132.pxrVULTN-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-5.4.y head: 35c6471fd2c181f6e5e0b292dc759b49dbd95d6a commit: ce1aa09cc14ed625104acc2d487bd92b9a88efe2 [2861/3729] NFSD: prevent integer overflow on 32 bit systems config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/20220607/202206072132.pxrVULTN-lkp@intel.com/config) compiler: sparc64-linux-gcc (GCC) 11.3.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://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=ce1aa09cc14ed625104acc2d487bd92b9a88efe2 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-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-11.3.0 make.cross W=1 O=build_dir ARCH=sparc 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: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 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://01.org/lkp