Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1439753ybj; Fri, 8 May 2020 01:07:19 -0700 (PDT) X-Google-Smtp-Source: APiQypKPGxs9cWthfQJ4Vvk9IZENfhoDZvzD/6hAe/WA1eJt0jHV25PEtTMzdPUGe6lJbjr0kp5m X-Received: by 2002:a05:6402:356:: with SMTP id r22mr1175290edw.3.1588925239426; Fri, 08 May 2020 01:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588925239; cv=none; d=google.com; s=arc-20160816; b=eCewqSR24ViWsb+kYKQrkM0NErIKB7Fx6K+kVOFDEQcgi11GsCt8OPE3kVQ1+rLmoC em9E6+fb983ie0vmMvH5r1/QJrTdqbMaEopyuM2oQMRvgXFXch+pCXmiSbD9wDz2UX+Z kAxPy16jBBC7ECD5LgVUJ0cNyF2QY++FF/7aMW3rVo3WLWnXzB+yu86P1HsKMz/vQl6M yePbHC06QQ9jbQFa75+o1ZhJ2PX2cbIsMbW4eOcFYGkmlFK93aPR6olT5H9tE4Eru6LF La6IkbfH9ChkYZ0rpXB/sqUhZze7WltevQnIXh20P+WHX2+BMgAKDmTCJ3Men7Rzzi7d MNvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:subject:cc:to :from:date:dkim-signature; bh=OZl/A3hOGE7YOG8QgDwubPlNXC1utjxlKtLllgAQiD8=; b=MsiXnSK4xE1NWNBoXrVzIxAHI1SscXdZlHy96gAfToHmO/E2GixMLTG4AjXKdAZUS4 degcDUfp1TJEYgF03gTOob4wpQDcaolVSO5TaF5K7R7DbyzJBfaqbek5S/kWpaUEkfZZ hPQCxxcY9JhOpuUoavNihE//lcMons9cPSVp+HvUDjDgy0rWv84WYAxBx8C96wimQ8KD zn1J5uNuY9IIdMeUC+8KiML9eV5Oyn1C9PsMKle7ClQpSIavgcR3RPnywG1RS2HLjyEQ ukz8pynQ5wKK5UcVS5vC4f3tefBuYZnvkTbR4+NVD1EGZ5eeVZRsl22WMcrlXHD+p9no PPgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canb.auug.org.au header.s=201702 header.b=khSI8fbO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v19si483250edr.209.2020.05.08.01.06.55; Fri, 08 May 2020 01:07:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@canb.auug.org.au header.s=201702 header.b=khSI8fbO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726761AbgEHIFd (ORCPT + 99 others); Fri, 8 May 2020 04:05:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726036AbgEHIFc (ORCPT ); Fri, 8 May 2020 04:05:32 -0400 Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32406C05BD43; Fri, 8 May 2020 01:05:32 -0700 (PDT) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 49JNDS22fNz9sSk; Fri, 8 May 2020 18:05:28 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=canb.auug.org.au; s=201702; t=1588925129; bh=F4X1gYE+pfegdxl3zi0f5sR1u9ohhPj7XClYVF3+g4g=; h=Date:From:To:Cc:Subject:From; b=khSI8fbOg/1K0zEKgkk2SFu4f7euOnwAfnRRaha0Y7Ch5PBCm6j7+tmUw9dfpayJi gihETPB1+VrK7rAC3FRHPV0oLFiwAXb3Y0MLc3U0YS9Vkir/4wOPyA7VM9i7JhY8oq sGiPEZsqvV2fmeEXFBe9y0902nzdsbI7z5LsoScOgPJhbR4jtF1S4tlBx5NZ5KkauU xgVarxbzoppGoK66FMVQtlIvVRqh+L0cSRjIY8U2F79fq9AvsFZ8XF1IdzshKgSLQz Y6zqjH7ikEvVRyI+C9Hg6a20sXPJsFtw4EHsOzDV6z8IrDTE6jCA4itzf7SbCqWvn8 efILDNGDnziWA== Date: Fri, 8 May 2020 18:05:24 +1000 From: Stephen Rothwell To: Jiri Kosina , Josh Poimboeuf , Miroslav Benes , Petr Mladek , Joe Lawrence , Jessica Yu Cc: Linux Next Mailing List , Linux Kernel Mailing List , Peter Zijlstra Subject: linux-next: manual merge of the livepatching tree with the modules tree Message-ID: <20200508180524.6995b07e@canb.auug.org.au> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/zQSwp35U6Oy695F0wOUlMTo"; protocol="application/pgp-signature"; micalg=pgp-sha256 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sig_/zQSwp35U6Oy695F0wOUlMTo Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hi all, Today's linux-next merge of the livepatching tree got a conflict in: kernel/module.c between commits: db991af02f11 ("module: break nested ARCH_HAS_STRICT_MODULE_RWX and STRICT= _MODULE_RWX #ifdefs") 5c3a7db0c7ec ("module: Harden STRICT_MODULE_RWX") from the modules tree and commit: e6eff4376e28 ("module: Make module_enable_ro() static again") from the livepatching tree. I fixed it up (see below) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts. --=20 Cheers, Stephen Rothwell diff --cc kernel/module.c index c69291362676,a26343ea4d50..000000000000 --- a/kernel/module.c +++ b/kernel/module.c @@@ -2055,29 -2023,20 +2042,30 @@@ static void module_enable_nx(const stru frob_writable_data(&mod->init_layout, set_memory_nx); } =20 +static int module_enforce_rwx_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, + char *secstrings, struct module *mod) +{ + const unsigned long shf_wx =3D SHF_WRITE|SHF_EXECINSTR; + int i; + + for (i =3D 0; i < hdr->e_shnum; i++) { + if ((sechdrs[i].sh_flags & shf_wx) =3D=3D shf_wx) + return -ENOEXEC; + } + + return 0; +} + #else /* !CONFIG_STRICT_MODULE_RWX */ +/* module_{enable,disable}_ro() stubs are in module.h */ static void module_enable_nx(const struct module *mod) { } + static void module_enable_ro(const struct module *mod, bool after_init) {} -#endif /* CONFIG_STRICT_MODULE_RWX */ -static void module_enable_x(const struct module *mod) +static int module_enforce_rwx_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, + char *secstrings, struct module *mod) { - frob_text(&mod->core_layout, set_memory_x); - frob_text(&mod->init_layout, set_memory_x); + return 0; } -#else /* !CONFIG_ARCH_HAS_STRICT_MODULE_RWX */ -static void module_enable_nx(const struct module *mod) { } -static void module_enable_x(const struct module *mod) { } -#endif /* CONFIG_ARCH_HAS_STRICT_MODULE_RWX */ - +#endif /* CONFIG_STRICT_MODULE_RWX */ =20 #ifdef CONFIG_LIVEPATCH /* --Sig_/zQSwp35U6Oy695F0wOUlMTo Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEENIC96giZ81tWdLgKAVBC80lX0GwFAl61EsUACgkQAVBC80lX 0Gy+Nwf/QwPmeO+0MwhkZtGBK96zqtJ8AtW7o6pMslU2qtP0RqQmaS/wFfQo/7bk wliasNDFacduHLf/I82FGoG0r1TIiVWCPuiNAPdTqfb7rldqrFnb07NDfzLhwSFQ +IJyKoZAByvDTKtlV6Q6HC9Ki8ecKMwT37EG1lUQgCyX23mET7sf3vUQgDqMM8Wo TtneBKwOGSkRzELMAEcJwwgh4Gnrt0SgW1bG4q0OvdhVOMvjaVb+h0G7HdPHFyVD sz0yCzFU58+2Qqxdfi3W8AfRUNDoOcMTE06txH0GehjfJBCQouu6IPcrJz0gO/92 eSPq9C+1Bu/qShR4rBxsIfi15RKmfw== =QMwq -----END PGP SIGNATURE----- --Sig_/zQSwp35U6Oy695F0wOUlMTo--