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 D660BEE3F3F for ; Tue, 12 Sep 2023 23:26:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 241A06B0142; Tue, 12 Sep 2023 19:26:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1F1F86B0144; Tue, 12 Sep 2023 19:26:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0BA196B0153; Tue, 12 Sep 2023 19:26:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id F0A076B0142 for ; Tue, 12 Sep 2023 19:26:13 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id B1D29120C8F for ; Tue, 12 Sep 2023 23:26:13 +0000 (UTC) X-FDA: 81229531026.10.92B898A Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by imf19.hostedemail.com (Postfix) with ESMTP id 72C621A0017 for ; Tue, 12 Sep 2023 23:26:11 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=ALDVxGw2; spf=pass (imf19.hostedemail.com: domain of lkp@intel.com designates 192.55.52.136 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=1694561171; 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: references:dkim-signature; bh=jO9TGjgA1iVl4KqLZzNpl2nu5GJwno6C8+1Snavr15M=; b=ZNWAthN9qWIKwXwA8zJIBwvMwctNkryya/5w7n26+kyDWSZXaaQpSGJSsJcNcOlO6T4QWn Ae/dTWXVl0OgdRgyp/pLXRFjII4WtNVEzALpGlnsovUYJ5ChcLlJv1uYB0yXcJbOZf3hxQ zK7vAJHhWibr0GtM0cqdZ0p00SsBkWw= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1694561171; a=rsa-sha256; cv=none; b=5M6QeQ7xozcC79v3qdnhULH0pbhVrQT51RIbV/LjD+Ybkwu5W2NPwhzv8iHI1WbqSNTER2 rb+4HOeK+mcY7SzkKsW6FQ7dAM5Z+fpi8jXLf239mcyVPofREZrryJHgkfFkahzkM9ZQ6I YY1CaQaFioKobe123QvHnDR5I2QNuiM= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=ALDVxGw2; spf=pass (imf19.hostedemail.com: domain of lkp@intel.com designates 192.55.52.136 as permitted sender) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694561171; x=1726097171; h=date:from:to:cc:subject:message-id:mime-version; bh=OOd4iDFnuesv4ZgCoZ1puxSq4PknMkeBOFAvFJ+R6MY=; b=ALDVxGw2nkeVfZTBSR9ir0GdDJtRXCqybEhVehsFNVTfcEA2feEqODb6 igY5Spucm61KnuJEIbIndcJoRlqxiGTW2xIJPm2NwBDf5kjgebVisRF/i joW8UYFxwSt2G8/r1BeqwK8TuFZV/WL27LMHVNokmCRrabFXkAfHfwRyn cQIe4CTZubwf/O+qkeiynVYK5sUjK1QCyNW6dsDbHuPeMKKJ6vOLFgbWo 9A3s9JZFF5C67oCXoWFdtnJHL8DH2v10tk+gm6d0A4qMXNLfhXvb5Cn/y bvNlg4gDSpka11ZSDLMWu8X8upKOmEpmDuUQ0NFmimMBkjTBjrXswnMTx g==; X-IronPort-AV: E=McAfee;i="6600,9927,10831"; a="357951309" X-IronPort-AV: E=Sophos;i="6.02,141,1688454000"; d="scan'208";a="357951309" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2023 16:26:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10831"; a="1074719693" X-IronPort-AV: E=Sophos;i="6.02,141,1688454000"; d="scan'208";a="1074719693" Received: from lkp-server02.sh.intel.com (HELO 47e905db7d2b) ([10.239.97.151]) by fmsmga005.fm.intel.com with ESMTP; 12 Sep 2023 16:26:08 -0700 Received: from kbuild by 47e905db7d2b with local (Exim 4.96) (envelope-from ) id 1qgCli-0000SH-0e; Tue, 12 Sep 2023 23:26:06 +0000 Date: Wed, 13 Sep 2023 07:25:12 +0800 From: kernel test robot To: Kent Overstreet Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, Linux Memory Management List Subject: [linux-next:master 2964/4552] fs/bcachefs/checksum.c:141:22: warning: comparison of distinct pointer types ('typeof (len) *' (aka 'unsigned int *') and 'typeof ((1UL << 12) - offset) *' (aka 'unsigned long *')) Message-ID: <202309130731.DmlgIRNJ-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Queue-Id: 72C621A0017 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: 3mkrcsmy9fkszay3nz1oyzuxfs8d3t6c X-HE-Tag: 1694561171-198367 X-HE-Meta: U2FsdGVkX19UASX6DhA3cKJ75cLTMBhll6ACaFdV71NP/V4zUT6z95ndY57UIZrqQNDXq8dLRAUEpfNf8KRdWqcgcQ6PH9gaNtu4O/FNpp2LcWUSLdcH6IO/DZoyR+u09zVXgdP2G7KsKDJLeGB4Ufsza7i/w1Y7Vj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Yv7Qkbu984IXLlLxxqOOElgzF/jMwU+LW/orG0OPLuDzrbwzv9jS/65QaZpTMqEnOpk8jDLOvURMSNri/ABdn/lwbsvUnPA== 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: tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 3c13c772fc233a10342c8e1605ff0855dfdf0c89 commit: 1fb50457684f1616ad05438cc16fd8f7d5b367b2 [2964/4552] bcachefs: Fix memory corruption in encryption path config: powerpc-randconfig-r006-20230912 (https://download.01.org/0day-ci/archive/20230913/202309130731.DmlgIRNJ-lkp@intel.com/config) compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230913/202309130731.DmlgIRNJ-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202309130731.DmlgIRNJ-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from fs/bcachefs/checksum.c:2: In file included from fs/bcachefs/bcachefs.h:188: In file included from include/linux/bio.h:10: In file included from include/linux/blk_types.h:10: In file included from include/linux/bvec.h:10: In file included from include/linux/highmem.h:12: In file included from include/linux/hardirq.h:11: In file included from arch/powerpc/include/asm/hardirq.h:6: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:672: arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 47 | DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 48 | (p, b, c), pio, p) | ~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET' 669 | __do_##name al; \ | ^~~~~~~~~~~~~~ :211:1: note: expanded from here 211 | __do_insl | ^ arch/powerpc/include/asm/io.h:611:56: note: expanded from macro '__do_insl' 611 | #define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n)) | ~~~~~~~~~~~~~~~~~~~~~^ In file included from fs/bcachefs/checksum.c:2: In file included from fs/bcachefs/bcachefs.h:188: In file included from include/linux/bio.h:10: In file included from include/linux/blk_types.h:10: In file included from include/linux/bvec.h:10: In file included from include/linux/highmem.h:12: In file included from include/linux/hardirq.h:11: In file included from arch/powerpc/include/asm/hardirq.h:6: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:672: arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 49 | DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 50 | (p, b, c), pio, p) | ~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET' 669 | __do_##name al; \ | ^~~~~~~~~~~~~~ :213:1: note: expanded from here 213 | __do_outsb | ^ arch/powerpc/include/asm/io.h:612:58: note: expanded from macro '__do_outsb' 612 | #define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) | ~~~~~~~~~~~~~~~~~~~~~^ In file included from fs/bcachefs/checksum.c:2: In file included from fs/bcachefs/bcachefs.h:188: In file included from include/linux/bio.h:10: In file included from include/linux/blk_types.h:10: In file included from include/linux/bvec.h:10: In file included from include/linux/highmem.h:12: In file included from include/linux/hardirq.h:11: In file included from arch/powerpc/include/asm/hardirq.h:6: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:672: arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 51 | DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 52 | (p, b, c), pio, p) | ~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET' 669 | __do_##name al; \ | ^~~~~~~~~~~~~~ :215:1: note: expanded from here 215 | __do_outsw | ^ arch/powerpc/include/asm/io.h:613:58: note: expanded from macro '__do_outsw' 613 | #define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) | ~~~~~~~~~~~~~~~~~~~~~^ In file included from fs/bcachefs/checksum.c:2: In file included from fs/bcachefs/bcachefs.h:188: In file included from include/linux/bio.h:10: In file included from include/linux/blk_types.h:10: In file included from include/linux/bvec.h:10: In file included from include/linux/highmem.h:12: In file included from include/linux/hardirq.h:11: In file included from arch/powerpc/include/asm/hardirq.h:6: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/powerpc/include/asm/io.h:672: arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 53 | DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 54 | (p, b, c), pio, p) | ~~~~~~~~~~~~~~~~~~ arch/powerpc/include/asm/io.h:669:3: note: expanded from macro 'DEF_PCI_AC_NORET' 669 | __do_##name al; \ | ^~~~~~~~~~~~~~ :217:1: note: expanded from here 217 | __do_outsl | ^ arch/powerpc/include/asm/io.h:614:58: note: expanded from macro '__do_outsl' 614 | #define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n)) | ~~~~~~~~~~~~~~~~~~~~~^ >> fs/bcachefs/checksum.c:141:22: warning: comparison of distinct pointer types ('typeof (len) *' (aka 'unsigned int *') and 'typeof ((1UL << 12) - offset) *' (aka 'unsigned long *')) [-Wcompare-distinct-pointer-types] 141 | unsigned pg_len = min(len, PAGE_SIZE - offset); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:68:19: note: expanded from macro 'min' 68 | #define min(x, y) __careful_cmp(x, y, <) | ^~~~~~~~~~~~~~~~~~~~~~ include/linux/minmax.h:37:24: note: expanded from macro '__careful_cmp' 37 | __builtin_choose_expr(__safe_cmp(x, y), \ | ^~~~~~~~~~~~~~~~ include/linux/minmax.h:27:4: note: expanded from macro '__safe_cmp' 27 | (__typecheck(x, y) && __no_side_effects(x, y)) | ^~~~~~~~~~~~~~~~~ include/linux/minmax.h:21:28: note: expanded from macro '__typecheck' 21 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) | ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ 7 warnings generated. Kconfig warnings: (for reference only) WARNING: unmet direct dependencies detected for HOTPLUG_CPU Depends on [n]: SMP [=y] && (PPC_PSERIES [=n] || PPC_PMAC [=n] || PPC_POWERNV [=n] || FSL_SOC_BOOKE [=n]) Selected by [y]: - PM_SLEEP_SMP [=y] && SMP [=y] && (ARCH_SUSPEND_POSSIBLE [=n] || ARCH_HIBERNATION_POSSIBLE [=y]) && PM_SLEEP [=y] vim +141 fs/bcachefs/checksum.c 112 113 static inline int do_encrypt(struct crypto_sync_skcipher *tfm, 114 struct nonce nonce, 115 void *buf, size_t len) 116 { 117 if (!is_vmalloc_addr(buf)) { 118 struct scatterlist sg; 119 120 sg_init_table(&sg, 1); 121 sg_set_page(&sg, 122 is_vmalloc_addr(buf) 123 ? vmalloc_to_page(buf) 124 : virt_to_page(buf), 125 len, offset_in_page(buf)); 126 return do_encrypt_sg(tfm, nonce, &sg, len); 127 } else { 128 unsigned pages = buf_pages(buf, len); 129 struct scatterlist *sg; 130 size_t orig_len = len; 131 int ret, i; 132 133 sg = kmalloc_array(sizeof(*sg), pages, GFP_KERNEL); 134 if (!sg) 135 return -ENOMEM; 136 137 sg_init_table(sg, pages); 138 139 for (i = 0; i < pages; i++) { 140 unsigned offset = offset_in_page(buf); > 141 unsigned pg_len = min(len, PAGE_SIZE - offset); 142 143 sg_set_page(sg + i, vmalloc_to_page(buf), pg_len, offset); 144 buf += pg_len; 145 len -= pg_len; 146 } 147 148 ret = do_encrypt_sg(tfm, nonce, sg, orig_len); 149 kfree(sg); 150 return ret; 151 } 152 } 153 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki