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: <3e1ffd2e-b002-48b5-b41c-24787aa652e3@amazon.com>
Date: Wed, 21 May 2025 17:30:32 +0200
From: Alexander Graf <graf@...zon.com>
To: Baoquan He <bhe@...hat.com>, Zhongkun He <hezhongkun.hzk@...edance.com>
CC: <kexec@...ts.infradead.org>, <linux-kernel@...r.kernel.org>, Andrew Morton
	<akpm@...ux-foundation.org>, Pasha Tatashin <pasha.tatashin@...een.com>,
	<nh-open-source@...zon.com>
Subject: Re: [PATCH v3] kexec: Enable CMA based contiguous allocation


On 21.05.25 12:30, Baoquan He wrote:
>
> On 05/21/25 at 03:47pm, Zhongkun He wrote:
>> On Wed, May 14, 2025 at 2:40 AM Alexander Graf <graf@...zon.com> wrote:
> ......
>>>   /**
>>>    * kexec_locate_mem_hole - find free memory for the purgatory or the next kernel
>>>    * @kbuf:      Parameters for the memory search.
>>> @@ -648,6 +684,13 @@ int kexec_locate_mem_hole(struct kexec_buf *kbuf)
>>>          if (kbuf->mem != KEXEC_BUF_MEM_UNKNOWN)
>>>                  return 0;
>>>
>>> +       /*
>>> +        * Try to find a free physically contiguous block of memory first. With that, we
>>> +        * can avoid any copying at kexec time.
>>> +        */
>>> +       if (!kexec_alloc_contig(kbuf))
>>> +               return 0;
>> IIUC, The kexec_locate_mem_hole() function is also used in
>> the KEXEC_TYPE_CRASH kimage, but kexec_alloc_contig() does not skip it.
>> This can cause kdump to fail and lead to CMA memory leakage.
> That is true and good catch, and fix is needed to skip cma alloc for
> kdump.


Thanks for catching this! I added a check to ensure we don't use the CMA 
logic with crash kernels in v4 and posted it.


Alex





Amazon Web Services Development Center Germany GmbH
Tamara-Danz-Str. 13
10243 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 257764 B
Sitz: Berlin
Ust-ID: DE 365 538 597

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ