From patchwork Mon Mar 27 18:42:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9647361 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CEBE0602BF for ; Mon, 27 Mar 2017 18:43:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4D1320952 for ; Mon, 27 Mar 2017 18:43:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B834728403; Mon, 27 Mar 2017 18:43:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id DE5D720952 for ; Mon, 27 Mar 2017 18:43:13 +0000 (UTC) Received: (qmail 26090 invoked by uid 550); 27 Mar 2017 18:43:11 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 26063 invoked from network); 27 Mar 2017 18:43:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ij+IgJZIhfdfnQ7ixXeE7JW+k/odQvqjuWLGBLv98D0=; b=gcPrAiVCzehgNh+EorIEShbSXMZSp970u+eYO5unT9XDTeBlXWp/b4hBZM1HuurrHY VDsSrB+jeHoesYN7zjPePWPiQPcvdN/L5qHyT3TDdO7Fo613KwSqbXSEttosdM0Y6uIw SkIRI2pcp9y80AvNCEUKkZ2l6+2v2zJyMQOnPE7ZYYc4Zm5nEmH5S1amrAIB+iT1PQcI w9eMxhW1H+7glj2GA4jEbgmLJj5nGnuOpQbSHMNB2IR234ww9iUH2YuuLmSwfIN0xuT2 c01uBKWlhdaUFfdM/YWvS/SAJ0kbuLMJOv3FisccwjUW+yX7XXF8WxuPtmGHWebFB0cv UWMA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ij+IgJZIhfdfnQ7ixXeE7JW+k/odQvqjuWLGBLv98D0=; b=nAcuN4BdB1ynNWlWmfgbFtR7g6fVd2henqYroPglKKNjWx9cctKUJQjEfspzsioO64 0vNzRT65b7SWVwxBgmGrB1AFcQ4fyOSyt2sMYNK4FLXNY5BNg1T0AZT3ILNTdrUxFxMK h7xOP2BZBLNcdLr/Y5YTmENj8rCY+tObNZZjE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ij+IgJZIhfdfnQ7ixXeE7JW+k/odQvqjuWLGBLv98D0=; b=XymSZYka77hDW//UbgE0WLexrLNQCFS9CwlBgib1vNkBaWA6vAuWNoCc0vmDHlFqZe Yc3V02WuRkViD/4aX+sv9x3mI8I1ebzIG5gchmxoLgL9PNkhmI8SKqekmfnY/h1dyN7I cDV+fWmEbiCvIy3WFfNNZ+0oavTW3QczVxjmi95fMgugpbA23bdsV2KfpXxx5wPGT8XV RXom7EcE/sieeufbRbuuPgNGzlcnO5BbcQUCNKvJ7Ym5VzdnTuOBCRf1ogrFXhfcSOJS +l4lVVJ9Y39F23za1Vv6mpgCjE0G93KffEPWqw962XxRl+eaJxWTbJDB268BszeDl1nw Tt4g== X-Gm-Message-State: AFeK/H18qmIbe2gze3akByprAybBhJbA+w1hXc76EgtYm1gcLnPh+bjWtGNbA8MKufGuiOxw5SSIY4gncsbAyWOK X-Received: by 10.107.133.159 with SMTP id p31mr14218922ioi.101.1490640178573; Mon, 27 Mar 2017 11:42:58 -0700 (PDT) MIME-Version: 1.0 Sender: keescook@google.com In-Reply-To: <201703271633.xbYHmB37%fengguang.wu@intel.com> References: <20170326210825.23255-3-ewk@edkovsky.org> <201703271633.xbYHmB37%fengguang.wu@intel.com> From: Kees Cook Date: Mon, 27 Mar 2017 11:42:57 -0700 X-Google-Sender-Auth: Lx1slzJgfmbrJ1Bx498zoGwsF-k Message-ID: To: Jakub Kicinski , Catalin Marinas , Heiko Carstens , Eddie Kovsky Cc: kbuild-all@01.org, kbuild test robot , Jessica Yu , Rusty Russell , LKML , "kernel-hardening@lists.openwall.com" Subject: [kernel-hardening] Re: [PATCH v4 2/2] extable: verify address is read-only X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Mar 27, 2017 at 1:43 AM, kbuild test robot wrote: > Hi Eddie, > > [auto build test ERROR on next-20170323] > [cannot apply to linus/master linux/master jeyu/modules-next v4.9-rc8 v4.9-rc7 v4.9-rc6 v4.11-rc4] > [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/Eddie-Kovsky/module-verify-address-is-read-only/20170327-142922 > config: blackfin-BF561-EZKIT-SMP_defconfig (attached as .config) > compiler: bfin-uclinux-gcc (GCC) 6.2.0 > reproduce: > wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # save the attached .config to linux build tree > make.cross ARCH=blackfin > > All errors (new ones prefixed by >>): > > kernel/built-in.o: In function `core_kernel_rodata': >>> kernel/extable.c:169: undefined reference to `__start_data_ro_after_init' >>> kernel/extable.c:169: undefined reference to `__start_data_ro_after_init' >>> kernel/extable.c:169: undefined reference to `__end_data_ro_after_init' >>> kernel/extable.c:169: undefined reference to `__end_data_ro_after_init' >>> kernel/extable.c:169: undefined reference to `__start_data_ro_after_init' >>> kernel/extable.c:169: undefined reference to `__start_data_ro_after_init' >>> kernel/extable.c:169: undefined reference to `__end_data_ro_after_init' >>> kernel/extable.c:169: undefined reference to `__end_data_ro_after_init' Hm, I'm confused about this. blackfin includes include/asm-generic-vmlinux.lds.h and uses the RO_DATA macro (which resolves to RO_DATA_SECTION to RO_AFTER_INIT_DATA which defines __[start|end]_data_ro_after_init. Also, it seems that commit d7c19b066dcf4bd19c4385e8065558d4e74f9e73 ("mm: kmemleak: scan .data.ro_after_init") added a potentially redundant section name (s390 already calls this __[start|end]_ro_after_init). I'd like to get this cleaned up, since having multiple names for the same thing is confusing: And it seems that this hunk is wrong (__end_ro_after_init includes s390's exception table, etc). I think we should remove the ..._data_... name and use s390's name. I'll send an adjustment patch, but we'll still need to deal with blackfin. -Kees > > vim +169 kernel/extable.c > > 163 int core_kernel_rodata(unsigned long addr) > 164 { > 165 if (addr >= (unsigned long)__start_rodata && > 166 addr < (unsigned long)__end_rodata) > 167 return 1; > 168 > > 169 if (addr >= (unsigned long)__start_data_ro_after_init && > 170 addr < (unsigned long)__end_data_ro_after_init) > 171 return 1; > 172 > > --- > 0-DAY kernel test infrastructure Open Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S index 000e6e91f6a0..3667d20e997f 100644 --- a/arch/s390/kernel/vmlinux.lds.S +++ b/arch/s390/kernel/vmlinux.lds.S @@ -62,9 +62,11 @@ SECTIONS . = ALIGN(PAGE_SIZE); __start_ro_after_init = .; + __start_data_ro_after_init = .; .data..ro_after_init : { *(.data..ro_after_init) } + __end_data_ro_after_init = .; EXCEPTION_TABLE(16) . = ALIGN(PAGE_SIZE); __end_ro_after_init = .;