linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Christoffer Dall <cdall@cs.columbia.edu>,
	Marc Zyngier <maz@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Oliver Upton <oliver.upton@linux.dev>
Subject: linux-next: manual merge of the kvm-arm tree with the arm64 tree
Date: Thu, 15 Jun 2023 12:45:58 +1000	[thread overview]
Message-ID: <20230615124558.2cea58b3@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 2792 bytes --]

Hi all,

Today's linux-next merge of the kvm-arm tree got a conflict in:

  arch/arm64/kernel/kaslr.c

between commit:

  6e13b6b923b3 ("arm64: kaslr: split kaslr/module initialization")
  e46b7103aef3 ("arm64: module: move module randomization to module.c")

from the arm64 tree and commit:

  0ddc312b7c73 ("arm64: Turn kaslr_feature_override into a generic SW feature override")

from the kvm-arm 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.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/arm64/kernel/kaslr.c
index 17f96a19781d,5d4ce7f5f157..000000000000
--- a/arch/arm64/kernel/kaslr.c
+++ b/arch/arm64/kernel/kaslr.c
@@@ -4,33 -4,46 +4,33 @@@
   */
  
  #include <linux/cache.h>
 -#include <linux/crc32.h>
  #include <linux/init.h>
 -#include <linux/libfdt.h>
 -#include <linux/mm_types.h>
 -#include <linux/sched.h>
 -#include <linux/types.h>
 -#include <linux/pgtable.h>
 -#include <linux/random.h>
 +#include <linux/printk.h>
  
 -#include <asm/fixmap.h>
 -#include <asm/kernel-pgtable.h>
 +#include <asm/cpufeature.h>
  #include <asm/memory.h>
 -#include <asm/mmu.h>
 -#include <asm/sections.h>
 -#include <asm/setup.h>
  
 -u64 __ro_after_init module_alloc_base;
  u16 __initdata memstart_offset_seed;
  
- struct arm64_ftr_override kaslr_feature_override __initdata;
- 
 -static int __init kaslr_init(void)
 +bool __ro_after_init __kaslr_is_enabled = false;
 +
 +void __init kaslr_init(void)
  {
- 	if (kaslr_feature_override.val & kaslr_feature_override.mask & 0xf) {
 -	u64 module_range;
 -	u32 seed;
 -
 -	/*
 -	 * Set a reasonable default for module_alloc_base in case
 -	 * we end up running with module randomization disabled.
 -	 */
 -	module_alloc_base = (u64)_etext - MODULES_VSIZE;
 -
+ 	if (cpuid_feature_extract_unsigned_field(arm64_sw_feature_override.val &
+ 						 arm64_sw_feature_override.mask,
+ 						 ARM64_SW_FEATURE_OVERRIDE_NOKASLR)) {
  		pr_info("KASLR disabled on command line\n");
 -		return 0;
 +		return;
  	}
  
 -	if (!kaslr_enabled()) {
 +	/*
 +	 * The KASLR offset modulo MIN_KIMG_ALIGN is taken from the physical
 +	 * placement of the image rather than from the seed, so a displacement
 +	 * of less than MIN_KIMG_ALIGN means that no seed was provided.
 +	 */
 +	if (kaslr_offset() < MIN_KIMG_ALIGN) {
  		pr_warn("KASLR disabled due to lack of seed\n");
 -		return 0;
 +		return;
  	}
  
  	pr_info("KASLR enabled\n");

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2023-06-15  2:46 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15  2:45 Stephen Rothwell [this message]
2023-06-15  7:37 ` linux-next: manual merge of the kvm-arm tree with the arm64 tree Oliver Upton
2023-06-15  8:32   ` Catalin Marinas
  -- strict thread matches above, loose matches on Subject: below --
2024-03-08  1:54 Stephen Rothwell
2024-03-08  6:25 ` Oliver Upton
2024-03-08 12:30   ` Catalin Marinas
2024-03-08  1:47 Stephen Rothwell
2024-02-20  2:21 Stephen Rothwell
2024-02-19  2:58 Stephen Rothwell
2024-02-19 12:14 ` Catalin Marinas
2024-02-19 15:22   ` Marc Zyngier
2024-02-19 15:35     ` Mark Rutland
2024-02-19 15:43     ` Ard Biesheuvel
2024-02-19 16:49     ` Catalin Marinas
2023-10-24  2:28 Stephen Rothwell
2023-10-24  6:49 ` Oliver Upton
2023-10-17  1:30 Stephen Rothwell
2023-10-17 11:13 ` Catalin Marinas
2023-10-18 23:02   ` Oliver Upton
2023-11-01  2:36 ` Stephen Rothwell
2023-06-15  2:22 Stephen Rothwell
2023-06-15  7:14 ` Catalin Marinas
2023-07-03  0:50 ` Stephen Rothwell
2023-06-06  1:49 Stephen Rothwell
2023-06-06  9:20 ` Catalin Marinas
2023-06-07  1:05 ` Stephen Rothwell
2023-06-07  5:33   ` Oliver Upton
2023-06-07  8:45     ` Catalin Marinas
2023-02-06  1:44 Stephen Rothwell
2023-02-06  4:21 ` Stephen Rothwell
2023-02-06  8:37 ` Marc Zyngier
2023-02-06  8:43   ` Marc Zyngier
2022-09-19  4:05 Stephen Rothwell
2022-09-19  9:04 ` Marc Zyngier
2022-09-23 10:26   ` Catalin Marinas
2022-05-04  4:35 Stephen Rothwell
2022-05-04  7:06 ` Marc Zyngier
2022-05-04  8:08   ` Catalin Marinas
2022-05-23  6:36 ` Stephen Rothwell
2021-08-19  4:05 Stephen Rothwell
2021-08-20  9:27 ` Catalin Marinas
2021-08-12  3:33 Stephen Rothwell
2021-06-23  5:58 Stephen Rothwell
2021-04-13  5:43 Stephen Rothwell
2021-04-13 11:21 ` Ard Biesheuvel
2021-01-27  5:24 Stephen Rothwell
2020-12-04  5:44 Stephen Rothwell
2020-12-04 11:12 ` Marc Zyngier
2020-12-04  5:17 Stephen Rothwell
2020-09-30  6:26 Stephen Rothwell
2020-05-29  7:00 Stephen Rothwell
2019-07-08  7:24 Stephen Rothwell
2018-10-04  4:22 Stephen Rothwell
2018-10-04  4:07 Stephen Rothwell
2018-07-23  4:46 Stephen Rothwell
2018-07-23 10:45 ` Marc Zyngier
2018-08-16  0:15 ` Stephen Rothwell
2018-08-17  8:32   ` Paolo Bonzini
2018-08-17  9:33     ` Marc Zyngier
2018-06-01  6:23 Stephen Rothwell
2018-06-01  8:23 ` Marc Zyngier
2018-06-01  6:13 Stephen Rothwell
2018-03-28  5:05 Stephen Rothwell
2018-03-29  5:16 ` Stephen Rothwell
2018-03-28  5:00 Stephen Rothwell
2018-03-28 11:53 ` Will Deacon
2017-08-25  4:57 Stephen Rothwell
2017-08-25  8:11 ` Marc Zyngier
2017-08-25  8:44   ` Christoffer Dall
2016-02-29  5:18 Stephen Rothwell
2016-02-24  2:38 Stephen Rothwell
2016-02-22  2:33 Stephen Rothwell
2016-02-22  9:26 ` Catalin Marinas
2016-02-22  2:28 Stephen Rothwell
2016-02-22  9:24 ` Catalin Marinas
2016-02-12  2:26 Stephen Rothwell
2015-01-22  5:07 Stephen Rothwell
2015-01-22  8:51 ` Marc Zyngier
2015-01-22 10:29   ` Mark Rutland
2015-01-22 23:05     ` Stephen Rothwell
2015-01-23  1:36   ` Wei Huang
2015-01-23 11:53   ` Christoffer Dall
2015-01-22  5:06 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230615124558.2cea58b3@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=catalin.marinas@arm.com \
    --cc=cdall@cs.columbia.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).