Re: [PATCH v2] bootconfig: use memblock_free_late to free xbc memory to buddy

2024-04-14 Thread Qiang Zhang
On Sat, Apr 13, 2024 at 09:21:38PM +0900, Masami Hiramatsu wrote: >Hi Qiang, > >I found xbc_free_mem() missed to check !addr. When I booted kernel without >bootconfig data but with "bootconfig" cmdline, I got a kernel crash below; > > >[2.394904] [ cut here ] >[

Re: [PATCH v2] bootconfig: use memblock_free_late to free xbc memory to buddy

2024-04-13 Thread Google
Hi Qiang, I found xbc_free_mem() missed to check !addr. When I booted kernel without bootconfig data but with "bootconfig" cmdline, I got a kernel crash below; [2.394904] [ cut here ] [2.396490] kernel BUG at arch/x86/mm/physaddr.c:28! [2.398176] invalid

Re: [PATCH v2] bootconfig: use memblock_free_late to free xbc memory to buddy

2024-04-12 Thread Google
On Fri, 12 Apr 2024 18:49:41 +0800 qiang4.zh...@linux.intel.com wrote: > From: Qiang Zhang > > On the time to free xbc memory in xbc_exit(), memblock may has handed > over memory to buddy allocator. So it doesn't make sense to free memory > back to memblock. memblock_free() called by xbc_exit()

[PATCH v2] bootconfig: use memblock_free_late to free xbc memory to buddy

2024-04-12 Thread qiang4 . zhang
From: Qiang Zhang On the time to free xbc memory in xbc_exit(), memblock may has handed over memory to buddy allocator. So it doesn't make sense to free memory back to memblock. memblock_free() called by xbc_exit() even causes UAF bugs on architectures with CONFIG_ARCH_KEEP_MEMBLOCK disabled