lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aTWV4vnTAYwoH1ZE@kernel.org>
Date: Sun, 7 Dec 2025 16:57:38 +0200
From: Mike Rapoport <rppt@...nel.org>
To: Usama Arif <usamaarif642@...il.com>
Cc: Pasha Tatashin <pasha.tatashin@...een.com>,
	Andrew Morton <akpm@...ux-foundation.org>, kas@...nel.org,
	changyuanl@...gle.com, graf@...zon.com, leitao@...ian.org,
	thevlad@...a.com, pratyush@...nel.org, dave.hansen@...ux.intel.com,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	kernel-team@...a.com
Subject: Re: [PATCH v3 2/2] mm/memblock: only mark/clear KHO scratch memory
 when needed

On Thu, Dec 04, 2025 at 07:27:29PM +0000, Usama Arif wrote:
> On 04/12/2025 17:52, Mike Rapoport wrote:
> >>
> >> So the patch was designed to remove the memblock_mark_kho_scratch in e820__memblock_setup if not
> >> in KHO boot. But it broke memblock_mark_kho_scratch in kho_populate.
> >> Moving kho_in.fdt_phys = fdt_phys to before the memblock_mark_scratch
> >> should fix it. I dont have a setup where I can easily test KHO, but I think below
> >> should fix it?

There's a simple KHO sefltest in tools/testing/selftest/kho

> > This might, but this is too late for v6.19-rc1.
> > For now I'm dropping this series from memblock/for-next.
> > We can resume working on this after merge window closes.
> >  
> 
> Yes makes sense.
> 
> How would you like me to proceed with the fix? Should I send just the fix now,
> or these 2 patches plus the fix after the merge window closes?

The fix should come before the changes in memblock_mark_kho_scratch(), so
please resend the whole series.
 
> >> diff --git a/kernel/liveupdate/kexec_handover.c b/kernel/liveupdate/kexec_handover.c
> >> index 9dc51fab604f1..c331749e6452e 100644
> >> --- a/kernel/liveupdate/kexec_handover.c
> >> +++ b/kernel/liveupdate/kexec_handover.c
> >> @@ -1483,6 +1483,7 @@ void __init kho_populate(phys_addr_t fdt_phys, u64 fdt_len,
> >>                 goto out;
> >>         }
> >>  
> >> +       kho_in.fdt_phys = fdt_phys;

This should happen before the calls to memblock_mark_kho_scratch().

> >>         /*
> >>          * We pass a safe contiguous blocks of memory to use for early boot
> >>          * purporses from the previous kernel so that we can resize the
> >> @@ -1513,7 +1514,6 @@ void __init kho_populate(phys_addr_t fdt_phys, u64 fdt_len,
> >>          */
> >>         memblock_set_kho_scratch_only();
> >>  
> >> -       kho_in.fdt_phys = fdt_phys;
> >>         kho_in.scratch_phys = scratch_phys;
> >>         kho_scratch_cnt = scratch_cnt;
> >>         pr_info("found kexec handover data.\n");
> >> @@ -1524,7 +1524,10 @@ void __init kho_populate(phys_addr_t fdt_phys, u64 fdt_len,
> >>         if (scratch)
> >>                 early_memunmap(scratch, scratch_len);
> >>         if (err)
> >> +       {
> >> +               kho_in.fdt_phys = 0;
> >>                 pr_warn("disabling KHO revival: %d\n", err);
> >> +       }
> >>  }
> > 
> 

-- 
Sincerely yours,
Mike.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ