From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gnuweeb.org (Postfix) with ESMTPS id 6BA9F804D1 for ; Thu, 15 Sep 2022 11:57:27 +0000 (UTC) Authentication-Results: gnuweeb.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=XV1tB6pT; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663243047; x=1694779047; h=date:from:to:cc:subject:message-id:mime-version; bh=9Mwz+ypBZTzC/NxxWku6wDHl30iXB0GD40rS4QpcYHk=; b=XV1tB6pTP/SPAwEt3TgQpb12D/GdkbGh8F58Q0o4WCMgf8ju4jffkDxw YNF85lSHwOgbWUhyhyoMuVq+L/NvSovVH6y+IUfYXKBrPFhSAa1nXevYX 5uwcn5tgMlM1q836Hfk7kIxbSxvqzLpbphHK6pBPoqH3MuE/vUl1zavaS +8UjgegEWcR9t4iZlJI1YWJeAkB2HGnh/rxXpyIT+BMiUcm8ewdEEOia5 /IPBdbMmupspkWCFh8m49yPmU7ZIYdkE1hWNKQAJJSu5YL40oaCDyOSr/ beo4O085kIzbUoPbvA0sB1n6ig3G9rK/EunYxow82eLXfg0d6Te/4b7MC w==; X-IronPort-AV: E=McAfee;i="6500,9779,10470"; a="362651227" X-IronPort-AV: E=Sophos;i="5.93,317,1654585200"; d="scan'208";a="362651227" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2022 04:56:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,317,1654585200"; d="scan'208";a="647796799" Received: from lkp-server02.sh.intel.com (HELO 41300c7200ea) ([10.239.97.151]) by orsmga008.jf.intel.com with ESMTP; 15 Sep 2022 04:56:05 -0700 Received: from kbuild by 41300c7200ea with local (Exim 4.96) (envelope-from ) id 1oYnTR-0000Up-0j; Thu, 15 Sep 2022 11:56:05 +0000 Date: Thu, 15 Sep 2022 19:55:29 +0800 From: kernel test robot To: Ammar Faizi , GNU/Weeb Mailing List Cc: kbuild-all@lists.01.org Subject: [ammarfaizi2-block:google/android/kernel/common/android12-5.10-2021-12 671/9999] lib/test_kasan_module.c:25:13: warning: variable 'unused' set but not used Message-ID: <202209151907.SgWkNuS6-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline List-Id: tree: https://github.com/ammarfaizi2/linux-block google/android/kernel/common/android12-5.10-2021-12 head: dbbb7b2f16b9fa3c706fe5b8c234431b97108bec commit: 916518ead7a5c918acbd0bdb48e8e5dd10e62bd8 [671/9999] FROMGIT: kasan: rename CONFIG_TEST_KASAN_MODULE config: arm64-buildonly-randconfig-r006-20220914 (https://download.01.org/0day-ci/archive/20220915/202209151907.SgWkNuS6-lkp@intel.com/config) compiler: aarch64-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/ammarfaizi2/linux-block/commit/916518ead7a5c918acbd0bdb48e8e5dd10e62bd8 git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block git fetch --no-tags ammarfaizi2-block google/android/kernel/common/android12-5.10-2021-12 git checkout 916518ead7a5c918acbd0bdb48e8e5dd10e62bd8 # 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=arm64 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot All warnings (new ones prefixed by >>): lib/test_kasan_module.c: In function 'copy_user_test': >> lib/test_kasan_module.c:25:13: warning: variable 'unused' set but not used [-Wunused-but-set-variable] 25 | int unused; | ^~~~~~ vim +/unused +25 lib/test_kasan_module.c 73228c7ecc5e40 Patricia Alfonso 2020-10-13 19 73228c7ecc5e40 Patricia Alfonso 2020-10-13 20 static noinline void __init copy_user_test(void) 73228c7ecc5e40 Patricia Alfonso 2020-10-13 21 { 73228c7ecc5e40 Patricia Alfonso 2020-10-13 22 char *kmem; 73228c7ecc5e40 Patricia Alfonso 2020-10-13 23 char __user *usermem; 73228c7ecc5e40 Patricia Alfonso 2020-10-13 24 size_t size = 10; 73228c7ecc5e40 Patricia Alfonso 2020-10-13 @25 int unused; 73228c7ecc5e40 Patricia Alfonso 2020-10-13 26 73228c7ecc5e40 Patricia Alfonso 2020-10-13 27 kmem = kmalloc(size, GFP_KERNEL); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 28 if (!kmem) 73228c7ecc5e40 Patricia Alfonso 2020-10-13 29 return; 73228c7ecc5e40 Patricia Alfonso 2020-10-13 30 73228c7ecc5e40 Patricia Alfonso 2020-10-13 31 usermem = (char __user *)vm_mmap(NULL, 0, PAGE_SIZE, 73228c7ecc5e40 Patricia Alfonso 2020-10-13 32 PROT_READ | PROT_WRITE | PROT_EXEC, 73228c7ecc5e40 Patricia Alfonso 2020-10-13 33 MAP_ANONYMOUS | MAP_PRIVATE, 0); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 34 if (IS_ERR(usermem)) { 73228c7ecc5e40 Patricia Alfonso 2020-10-13 35 pr_err("Failed to allocate user memory\n"); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 36 kfree(kmem); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 37 return; 73228c7ecc5e40 Patricia Alfonso 2020-10-13 38 } 73228c7ecc5e40 Patricia Alfonso 2020-10-13 39 73228c7ecc5e40 Patricia Alfonso 2020-10-13 40 pr_info("out-of-bounds in copy_from_user()\n"); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 41 unused = copy_from_user(kmem, usermem, size + 1 + OOB_TAG_OFF); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 42 73228c7ecc5e40 Patricia Alfonso 2020-10-13 43 pr_info("out-of-bounds in copy_to_user()\n"); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 44 unused = copy_to_user(usermem, kmem, size + 1 + OOB_TAG_OFF); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 45 73228c7ecc5e40 Patricia Alfonso 2020-10-13 46 pr_info("out-of-bounds in __copy_from_user()\n"); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 47 unused = __copy_from_user(kmem, usermem, size + 1 + OOB_TAG_OFF); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 48 73228c7ecc5e40 Patricia Alfonso 2020-10-13 49 pr_info("out-of-bounds in __copy_to_user()\n"); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 50 unused = __copy_to_user(usermem, kmem, size + 1 + OOB_TAG_OFF); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 51 73228c7ecc5e40 Patricia Alfonso 2020-10-13 52 pr_info("out-of-bounds in __copy_from_user_inatomic()\n"); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 53 unused = __copy_from_user_inatomic(kmem, usermem, size + 1 + OOB_TAG_OFF); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 54 73228c7ecc5e40 Patricia Alfonso 2020-10-13 55 pr_info("out-of-bounds in __copy_to_user_inatomic()\n"); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 56 unused = __copy_to_user_inatomic(usermem, kmem, size + 1 + OOB_TAG_OFF); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 57 73228c7ecc5e40 Patricia Alfonso 2020-10-13 58 pr_info("out-of-bounds in strncpy_from_user()\n"); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 59 unused = strncpy_from_user(kmem, usermem, size + 1 + OOB_TAG_OFF); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 60 73228c7ecc5e40 Patricia Alfonso 2020-10-13 61 vm_munmap((unsigned long)usermem, PAGE_SIZE); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 62 kfree(kmem); 73228c7ecc5e40 Patricia Alfonso 2020-10-13 63 } 73228c7ecc5e40 Patricia Alfonso 2020-10-13 64 :::::: The code at line 25 was first introduced by commit :::::: 73228c7ecc5e40c0851c4703c5ec6ed38123e989 KASAN: port KASAN Tests to KUnit :::::: TO: Patricia Alfonso :::::: CC: Linus Torvalds -- 0-DAY CI Kernel Test Service https://01.org/lkp