From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 267F733C4 for ; Wed, 21 Jun 2023 07:08:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1687331297; x=1718867297; h=date:from:to:cc:subject:message-id:mime-version; bh=/erwdCX8OMcKMJqQj6zyyU/YPHWLm0vP3sCgf3qmhL0=; b=G/+RSdyT92cJ6xkxJdkxVhOdpIhKHYAw5pNmZ/q1HSRTuAgBHXP7X4TW lB2SqKFtCWbY6WwKQNeJYLSxtM4P2bKXpyJ/o97asHs5bqnbmPhKzEUI/ OUto6pscRUqhAM6GeZc4SaTrR9wLsj00kCVS2g8sM9RMVKcYJuiDlTP6G OT6PS4Unf4WKukcnC86kxn+KfMf26ibXSCSdnmATZKAs0fAZ1rA4pclbZ KAjdHnqe5XHmY2ZiYHWpdXmN2kQKxV/ufEjteyO7PwFTRn9bHYLK04KBG HTFIuORP/BXt+Z1//5GDiPUUQICzRZvG+vbRvWMdONIXO0SpQb/SYJN3k A==; X-IronPort-AV: E=McAfee;i="6600,9927,10747"; a="360102359" X-IronPort-AV: E=Sophos;i="6.00,259,1681196400"; d="scan'208";a="360102359" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2023 00:08:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10747"; a="961067004" X-IronPort-AV: E=Sophos;i="6.00,259,1681196400"; d="scan'208";a="961067004" Received: from lkp-server01.sh.intel.com (HELO 783282924a45) ([10.239.97.150]) by fmsmga006.fm.intel.com with ESMTP; 21 Jun 2023 00:08:00 -0700 Received: from kbuild by 783282924a45 with local (Exim 4.96) (envelope-from ) id 1qBrwd-0006dR-1v; Wed, 21 Jun 2023 07:07:59 +0000 Date: Wed, 21 Jun 2023 15:07:18 +0800 From: kernel test robot To: oe-kbuild@lists.linux.dev Cc: lkp@intel.com Subject: Re: [PATCH 3/3] mm: check for VMA being detached before destroying it Message-ID: <202306211405.7zLvlu5T-lkp@intel.com> Precedence: bulk X-Mailing-List: oe-kbuild@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline :::::: :::::: Manual check reason: "um arch report" :::::: BCC: lkp@intel.com CC: llvm@lists.linux.dev CC: oe-kbuild-all@lists.linux.dev In-Reply-To: <20230620235726.3873043-3-surenb@google.com> References: <20230620235726.3873043-3-surenb@google.com> TO: Suren Baghdasaryan TO: akpm@linux-foundation.org CC: willy@infradead.org CC: torvalds@linuxfoundation.org CC: vegard.nossum@oracle.com CC: mpe@ellerman.id.au CC: Liam.Howlett@oracle.com CC: lrh2000@pku.edu.cn CC: mgorman@suse.de CC: linux-mm@kvack.org CC: linux-kernel@vger.kernel.org CC: kernel-team@android.com CC: surenb@google.com Hi Suren, kernel test robot noticed the following build warnings: [auto build test WARNING on akpm-mm/mm-everything] url: https://github.com/intel-lab-lkp/linux/commits/Suren-Baghdasaryan/mm-change-vma_start_read-to-fail-to-lock-a-detached-VMA/20230621-075833 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20230620235726.3873043-3-surenb%40google.com patch subject: [PATCH 3/3] mm: check for VMA being detached before destroying it :::::: branch date: 7 hours ago :::::: commit date: 7 hours ago config: um-randconfig-r012-20230620 (https://download.01.org/0day-ci/archive/20230621/202306211405.7zLvlu5T-lkp@intel.com/config) compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a) reproduce: (https://download.01.org/0day-ci/archive/20230621/202306211405.7zLvlu5T-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/r/202306211405.7zLvlu5T-lkp@intel.com/ All warnings (new ones prefixed by >>): In file included from include/linux/percpu-rwsem.h:7: In file included from include/linux/rcuwait.h:6: In file included from include/linux/sched/signal.h:6: include/linux/signal.h:241:10: warning: array index 1 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds] 241 | case 2: set->sig[1] = 0; | ^ ~ arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here 24 | unsigned long sig[_NSIG_WORDS]; | ^ In file included from net/ipv4/fib_trie.c:43: In file included from include/linux/mm.h:989: In file included from include/linux/huge_mm.h:8: In file included from include/linux/fs.h:33: In file included from include/linux/percpu-rwsem.h:7: In file included from include/linux/rcuwait.h:6: In file included from include/linux/sched/signal.h:6: include/linux/signal.h:254:10: warning: array index 1 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds] 254 | case 2: set->sig[1] = -1; | ^ ~ arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here 24 | unsigned long sig[_NSIG_WORDS]; | ^ In file included from net/ipv4/fib_trie.c:49: In file included from include/linux/inet.h:42: In file included from include/net/net_namespace.h:43: In file included from include/linux/skbuff.h:17: 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/um/include/asm/hardirq.h:5: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/um/include/asm/io.h:24: include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 547 | val = __raw_readb(PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 560 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); | ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu' 37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) | ^ In file included from net/ipv4/fib_trie.c:49: In file included from include/linux/inet.h:42: In file included from include/net/net_namespace.h:43: In file included from include/linux/skbuff.h:17: 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/um/include/asm/hardirq.h:5: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/um/include/asm/io.h:24: include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 573 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); | ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu' 35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) | ^ In file included from net/ipv4/fib_trie.c:49: In file included from include/linux/inet.h:42: In file included from include/net/net_namespace.h:43: In file included from include/linux/skbuff.h:17: 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/um/include/asm/hardirq.h:5: In file included from include/asm-generic/hardirq.h:17: In file included from include/linux/irq.h:20: In file included from include/linux/io.h:13: In file included from arch/um/include/asm/io.h:24: include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 584 | __raw_writeb(value, PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 594 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 604 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:692:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 692 | readsb(PCI_IOBASE + addr, buffer, count); | ~~~~~~~~~~ ^ include/asm-generic/io.h:700:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 700 | readsw(PCI_IOBASE + addr, buffer, count); | ~~~~~~~~~~ ^ include/asm-generic/io.h:708:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 708 | readsl(PCI_IOBASE + addr, buffer, count); | ~~~~~~~~~~ ^ include/asm-generic/io.h:717:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 717 | writesb(PCI_IOBASE + addr, buffer, count); | ~~~~~~~~~~ ^ include/asm-generic/io.h:726:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 726 | writesw(PCI_IOBASE + addr, buffer, count); | ~~~~~~~~~~ ^ include/asm-generic/io.h:735:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 735 | writesl(PCI_IOBASE + addr, buffer, count); | ~~~~~~~~~~ ^ >> net/ipv4/fib_trie.c:325:13: warning: implicit conversion from 'unsigned long' to 'u32' (aka 'unsigned int') changes value from 2305843009213693946 to 4294967290 [-Wconstant-conversion] 325 | if (bits > TNODE_VMALLOC_MAX) | ^~~~~~~~~~~~~~~~~ net/ipv4/fib_trie.c:306:35: note: expanded from macro 'TNODE_VMALLOC_MAX' 306 | ilog2((SIZE_MAX - TNODE_SIZE(0)) / sizeof(struct key_vector *)) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/log2.h:162:14: note: expanded from macro 'ilog2' 162 | __ilog2_u32(n) : \ | ~~~~~~~~~~~ ^ 62 warnings and 1 error generated. -- In file included from drivers/tty/tty_port.c:8: In file included from include/linux/tty.h:12: In file included from include/linux/tty_port.h:5: In file included from include/linux/kfifo.h:42: In file included from include/linux/scatterlist.h:8: include/linux/mm.h:753:7: error: no member named 'detached' in 'struct vm_area_struct' 753 | vma->detached = true; | ~~~ ^ In file included from drivers/tty/tty_port.c:8: In file included from include/linux/tty.h:12: In file included from include/linux/tty_port.h:5: In file included from include/linux/kfifo.h:42: In file included from include/linux/scatterlist.h:9: In file included from arch/um/include/asm/io.h:24: include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 547 | val = __raw_readb(PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 560 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr)); | ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu' 37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x)) | ^ In file included from drivers/tty/tty_port.c:8: In file included from include/linux/tty.h:12: In file included from include/linux/tty_port.h:5: In file included from include/linux/kfifo.h:42: In file included from include/linux/scatterlist.h:9: In file included from arch/um/include/asm/io.h:24: include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 573 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr)); | ~~~~~~~~~~ ^ include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu' 35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x)) | ^ In file included from drivers/tty/tty_port.c:8: In file included from include/linux/tty.h:12: In file included from include/linux/tty_port.h:5: In file included from include/linux/kfifo.h:42: In file included from include/linux/scatterlist.h:9: In file included from arch/um/include/asm/io.h:24: include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 584 | __raw_writeb(value, PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 594 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 604 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr); | ~~~~~~~~~~ ^ include/asm-generic/io.h:692:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 692 | readsb(PCI_IOBASE + addr, buffer, count); | ~~~~~~~~~~ ^ include/asm-generic/io.h:700:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 700 | readsw(PCI_IOBASE + addr, buffer, count); | ~~~~~~~~~~ ^ include/asm-generic/io.h:708:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 708 | readsl(PCI_IOBASE + addr, buffer, count); | ~~~~~~~~~~ ^ include/asm-generic/io.h:717:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 717 | writesb(PCI_IOBASE + addr, buffer, count); | ~~~~~~~~~~ ^ include/asm-generic/io.h:726:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 726 | writesw(PCI_IOBASE + addr, buffer, count); | ~~~~~~~~~~ ^ include/asm-generic/io.h:735:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic] 735 | writesl(PCI_IOBASE + addr, buffer, count); | ~~~~~~~~~~ ^ >> drivers/tty/tty_port.c:266:2: warning: implicit conversion from 'unsigned long' to 'unsigned int' changes value from 18446744073709551615 to 4294967295 [-Wconstant-conversion] 266 | INIT_KFIFO(port->xmit_fifo); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/kfifo.h:130:69: note: expanded from macro 'INIT_KFIFO' 130 | __kfifo->mask = __is_kfifo_ptr(__tmp) ? 0 : ARRAY_SIZE(__tmp->buf) - 1;\ | ~ ~~~~~~~~~~~~~~~~~~~~~~~^~~ 13 warnings and 1 error generated. vim +325 net/ipv4/fib_trie.c 37fd30f2da573c Alexander Duyck 2014-12-31 319 dc35dbeda3e00a Alexander Duyck 2015-03-06 320 static struct tnode *tnode_alloc(int bits) f0e36f8cee8101 Patrick McHardy 2005-07-05 321 { 1de3d87bcd2c2e Alexander Duyck 2015-03-04 322 size_t size; 1de3d87bcd2c2e Alexander Duyck 2015-03-04 323 1de3d87bcd2c2e Alexander Duyck 2015-03-04 324 /* verify bits is within bounds */ 1de3d87bcd2c2e Alexander Duyck 2015-03-04 @325 if (bits > TNODE_VMALLOC_MAX) 1de3d87bcd2c2e Alexander Duyck 2015-03-04 326 return NULL; 1de3d87bcd2c2e Alexander Duyck 2015-03-04 327 1de3d87bcd2c2e Alexander Duyck 2015-03-04 328 /* determine size and verify it is non-zero and didn't overflow */ 1de3d87bcd2c2e Alexander Duyck 2015-03-04 329 size = TNODE_SIZE(1ul << bits); 1de3d87bcd2c2e Alexander Duyck 2015-03-04 330 2373ce1ca04dd4 Robert Olsson 2005-08-25 331 if (size <= PAGE_SIZE) 8d96544475b236 Eric Dumazet 2008-01-13 332 return kzalloc(size, GFP_KERNEL); 15be75cdb5db44 Stephen Hemminger 2008-04-10 333 else 7a1c8e5ab120a5 Eric Dumazet 2010-11-20 334 return vzalloc(size); 15be75cdb5db44 Stephen Hemminger 2008-04-10 335 } 2373ce1ca04dd4 Robert Olsson 2005-08-25 336 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki