Received: by 10.223.185.116 with SMTP id b49csp311815wrg; Fri, 2 Mar 2018 20:01:19 -0800 (PST) X-Google-Smtp-Source: AG47ELtE38g/rgYg6F2kPLnvG6cUBzJCdAgsjYmj/jAIN9afYae967CcDS1uhX6zEm4l3IukZaTs X-Received: by 10.101.86.1 with SMTP id l1mr6338733pgs.140.1520049679227; Fri, 02 Mar 2018 20:01:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520049679; cv=none; d=google.com; s=arc-20160816; b=ZqByDa89WgFA7ZjiDy5SiCkdlArkQ9hcfqj6M878rVhTnNCRVdbEEcppZJlmqT5bvb ucGemS243NeKEzC7snPTS/j9mcwmZrdRrYqher+Nn9DVJtgIfXdYNkJPuJ69+RPGXYU3 e90DEZVsveInVzhWTDvazOBOZOsQ9u2HztJqH1Vl5su5Ov0elbOKn9Cahd6QSK5tjt+l Ay4KhBJDeE/gWS3MqO3CEx6ndPIkedpLUobXfZqr+Miq0ayb6joOngwtZ4jEJDQ1C0mS TSwIQzjuC/Mc0tH1QvWBxXudHOArUvW4rRDvD5dVWh7ypy9K5n1TojYvdpS+xK4Rqbyo ls6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=rHeC+5Qh+4crSVi8nCAdrHuaRZaYr9Y3iFH/1JR3jiM=; b=xkPXRBb3sdS2/54hiTpMhEvKVuFN/ANIe47h5CiTYYBvUMzcFi3EpNjFFrMDV0L5ET amv0881j9Zf4v5eJjuZgPu+ZsHnYR5t2xiLxRRuuCERxlGKwszMVPVcRqRaAQ5v9oiY2 IZHGOKYBTs+Awidc1e3WmWyqcKqwf+NDGoVWZTV/LmeVYW06ly/E36DxwxXbkTwyD8g8 tZcjE3rlUA5yb8qArl35C+cv/Ss5h1D4sFPL+HmsmbiDCU4hqjZUSw4p0JbptJ0m1iRM YrmtGRup9Zrt9eVAUJd4aEaDpfAJgcmoP2dxNsp7u1KnXxwRgS0oQq75msz7/x79B+Gg 60TA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 80si4500483pfn.73.2018.03.02.20.01.05; Fri, 02 Mar 2018 20:01:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935782AbeCCCgB (ORCPT + 99 others); Fri, 2 Mar 2018 21:36:01 -0500 Received: from mga04.intel.com ([192.55.52.120]:59944 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935764AbeCCCf7 (ORCPT ); Fri, 2 Mar 2018 21:35:59 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Mar 2018 18:35:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,415,1515484800"; d="scan'208";a="21536339" Received: from bee.sh.intel.com (HELO bee) ([10.239.97.14]) by fmsmga007.fm.intel.com with ESMTP; 02 Mar 2018 18:35:57 -0800 Received: from kbuild by bee with local (Exim 4.84_2) (envelope-from ) id 1erx1o-000DjW-FW; Sat, 03 Mar 2018 10:36:04 +0800 Date: Sat, 3 Mar 2018 10:35:22 +0800 From: kbuild test robot To: Igor Stoppa Cc: kbuild-all@01.org, david@fromorbit.com, willy@infradead.org, keescook@chromium.org, mhocko@kernel.org, labbott@redhat.com, linux-security-module@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Igor Stoppa Subject: Re: [PATCH 3/7] struct page: add field for vm_struct Message-ID: <201803031002.5HqxXcrB%fengguang.wu@intel.com> References: <20180228200620.30026-4-igor.stoppa@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180228200620.30026-4-igor.stoppa@huawei.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: fengguang.wu@intel.com X-SA-Exim-Scanned: No (on bee); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Igor, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on next-20180223] [cannot apply to linus/master mmotm/master char-misc/char-misc-testing v4.16-rc3 v4.16-rc2 v4.16-rc1 v4.16-rc3] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Igor-Stoppa/mm-security-ro-protection-for-dynamic-data/20180302-232215 reproduce: # apt-get install sparse make ARCH=x86_64 allmodconfig make C=1 CF=-D__CHECK_ENDIAN__ sparse warnings: (new ones prefixed by >>) lib/genalloc.c:624:29: sparse: undefined identifier 'exit_test' >> lib/genalloc.c:624:29: sparse: call with no type! In file included from arch/x86/include/asm/bug.h:83:0, from include/linux/bug.h:5, from include/linux/mmdebug.h:5, from include/linux/gfp.h:5, from include/linux/slab.h:15, from lib/genalloc.c:99: lib/genalloc.c: In function 'gen_pool_free': lib/genalloc.c:616:10: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'struct gen_pool *' [-Wformat=] "Trying to free unallocated memory" ^ include/asm-generic/bug.h:98:50: note: in definition of macro '__WARN_printf' #define __WARN_printf(arg...) do { __warn_printk(arg); __WARN(); } while (0) ^~~ lib/genalloc.c:615:5: note: in expansion of macro 'WARN' WARN(true, ^~~~ lib/genalloc.c:617:23: note: format string is defined here " from pool %s", pool); ~^ In file included from include/asm-generic/bug.h:5:0, from arch/x86/include/asm/bug.h:83, from include/linux/bug.h:5, from include/linux/mmdebug.h:5, from include/linux/gfp.h:5, from include/linux/slab.h:15, from lib/genalloc.c:99: lib/genalloc.c:624:17: error: implicit declaration of function 'exit_test'; did you mean 'exit_sem'? [-Werror=implicit-function-declaration] if (unlikely(exit_test(boundary < 0))) { ^ include/linux/compiler.h:77:42: note: in definition of macro 'unlikely' # define unlikely(x) __builtin_expect(!!(x), 0) ^ In file included from arch/x86/include/asm/bug.h:83:0, from include/linux/bug.h:5, from include/linux/mmdebug.h:5, from include/linux/gfp.h:5, from include/linux/slab.h:15, from lib/genalloc.c:99: lib/genalloc.c:626:16: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'struct gen_pool *' [-Wformat=] WARN(true, "Corrupted pool %s", pool); ^ include/asm-generic/bug.h:98:50: note: in definition of macro '__WARN_printf' #define __WARN_printf(arg...) do { __warn_printk(arg); __WARN(); } while (0) ^~~ lib/genalloc.c:626:5: note: in expansion of macro 'WARN' WARN(true, "Corrupted pool %s", pool); ^~~~ lib/genalloc.c:634:10: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'struct gen_pool *' [-Wformat=] "Size provided differs from size " ^ include/asm-generic/bug.h:98:50: note: in definition of macro '__WARN_printf' #define __WARN_printf(arg...) do { __warn_printk(arg); __WARN(); } while (0) ^~~ lib/genalloc.c:633:5: note: in expansion of macro 'WARN' WARN(true, ^~~~ lib/genalloc.c:635:31: note: format string is defined here "measured from pool %s", pool); ~^ In file included from arch/x86/include/asm/bug.h:83:0, from include/linux/bug.h:5, from include/linux/mmdebug.h:5, from include/linux/gfp.h:5, from include/linux/slab.h:15, from lib/genalloc.c:99: lib/genalloc.c:643:10: warning: format '%s' expects argument of type 'char *', but argument 2 has type 'struct gen_pool *' [-Wformat=] "Unexpected bitmap collision while" ^ include/asm-generic/bug.h:98:50: note: in definition of macro '__WARN_printf' #define __WARN_printf(arg...) do { __warn_printk(arg); __WARN(); } while (0) ^~~ lib/genalloc.c:642:5: note: in expansion of macro 'WARN' WARN(true, ^~~~ lib/genalloc.c:644:36: note: format string is defined here " freeing memory in pool %s", pool); ~^ cc1: some warnings being treated as errors vim +624 lib/genalloc.c 929f9727 Dean Nelson 2006-06-23 609 7f184275 Huang Ying 2011-07-13 610 rcu_read_lock(); 7f184275 Huang Ying 2011-07-13 611 list_for_each_entry_rcu(chunk, &pool->chunks, next_chunk) { 674470d9 Joonyoung Shim 2013-09-11 612 if (addr >= chunk->start_addr && addr <= chunk->end_addr) { 3406f868 Igor Stoppa 2018-02-28 613 if (unlikely(addr + size - 1 > chunk->end_addr)) { 7f184275 Huang Ying 2011-07-13 614 rcu_read_unlock(); 3406f868 Igor Stoppa 2018-02-28 615 WARN(true, 3406f868 Igor Stoppa 2018-02-28 616 "Trying to free unallocated memory" 3406f868 Igor Stoppa 2018-02-28 617 " from pool %s", pool); 7f184275 Huang Ying 2011-07-13 618 return; f14f75b8 Jes Sorensen 2005-06-21 619 } 3406f868 Igor Stoppa 2018-02-28 620 start_entry = (addr - chunk->start_addr) >> order; 3406f868 Igor Stoppa 2018-02-28 621 remaining_entries = (chunk->end_addr - addr) >> order; 3406f868 Igor Stoppa 2018-02-28 622 boundary = get_boundary(chunk->entries, start_entry, 3406f868 Igor Stoppa 2018-02-28 623 remaining_entries); 3406f868 Igor Stoppa 2018-02-28 @624 if (unlikely(exit_test(boundary < 0))) { 3406f868 Igor Stoppa 2018-02-28 625 rcu_read_unlock(); 3406f868 Igor Stoppa 2018-02-28 626 WARN(true, "Corrupted pool %s", pool); 3406f868 Igor Stoppa 2018-02-28 627 return; f14f75b8 Jes Sorensen 2005-06-21 628 } 3406f868 Igor Stoppa 2018-02-28 629 nentries = boundary - start_entry; 3406f868 Igor Stoppa 2018-02-28 630 if (unlikely(size && (nentries != 3406f868 Igor Stoppa 2018-02-28 631 mem_to_units(size, order)))) { 7f184275 Huang Ying 2011-07-13 632 rcu_read_unlock(); 3406f868 Igor Stoppa 2018-02-28 633 WARN(true, 3406f868 Igor Stoppa 2018-02-28 634 "Size provided differs from size " 3406f868 Igor Stoppa 2018-02-28 635 "measured from pool %s", pool); 3406f868 Igor Stoppa 2018-02-28 636 return; 3406f868 Igor Stoppa 2018-02-28 637 } 3406f868 Igor Stoppa 2018-02-28 638 remain = alter_bitmap_ll(CLEAR_BITS, chunk->entries, 3406f868 Igor Stoppa 2018-02-28 639 start_entry, nentries); 3406f868 Igor Stoppa 2018-02-28 640 if (unlikely(remain)) { 3406f868 Igor Stoppa 2018-02-28 641 rcu_read_unlock(); 3406f868 Igor Stoppa 2018-02-28 642 WARN(true, 3406f868 Igor Stoppa 2018-02-28 643 "Unexpected bitmap collision while" 3406f868 Igor Stoppa 2018-02-28 644 " freeing memory in pool %s", pool); 3406f868 Igor Stoppa 2018-02-28 645 return; 3406f868 Igor Stoppa 2018-02-28 646 } 3406f868 Igor Stoppa 2018-02-28 647 atomic_long_add(nentries << order, &chunk->avail); 3406f868 Igor Stoppa 2018-02-28 648 rcu_read_unlock(); 3406f868 Igor Stoppa 2018-02-28 649 return; 3406f868 Igor Stoppa 2018-02-28 650 } 3406f868 Igor Stoppa 2018-02-28 651 } 3406f868 Igor Stoppa 2018-02-28 652 rcu_read_unlock(); 3406f868 Igor Stoppa 2018-02-28 653 WARN(true, "address not found in pool %s", pool->name); f14f75b8 Jes Sorensen 2005-06-21 654 } f14f75b8 Jes Sorensen 2005-06-21 655 EXPORT_SYMBOL(gen_pool_free); 7f184275 Huang Ying 2011-07-13 656 :::::: The code at line 624 was first introduced by commit :::::: 3406f8684f722bb52edc94f65976585acb6382ce genalloc: track beginning of allocations :::::: TO: Igor Stoppa :::::: CC: 0day robot --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation