Re: [PATCH] coredump, vmcore: Set p_align to 4 for PT_NOTE

2023-05-16 Thread Kees Cook
On Fri, 12 May 2023 02:25:28 +, Fangrui Song wrote: > Tools like readelf/llvm-readelf use p_align to parse a PT_NOTE program > header as an array of 4-byte entries or 8-byte entries. Currently, there > are workarounds[1] in place for Linux to treat p_align==0 as 4. However, > it would be more a

Re: [PATCH 3/6] fs: distinguish between user initiated freeze and kernel initiated freeze

2023-05-16 Thread Darrick J. Wong
On Sun, May 07, 2023 at 06:17:14PM -0700, Luis Chamberlain wrote: > Userspace can initiate a freeze call using ioctls. If the kernel decides > to freeze a filesystem later it must be able to distinguish if userspace > had initiated the freeze, so that it does not unfreeze it later > automatically o

Re: [PATCH 6/6] fs: add automatic kernel fs freeze / thaw and remove kthread freezing

2023-05-16 Thread Darrick J. Wong
On Tue, May 09, 2023 at 11:20:13AM +1000, Dave Chinner wrote: > On Sun, May 07, 2023 at 06:17:17PM -0700, Luis Chamberlain wrote: > > Add support to automatically handle freezing and thawing filesystems > > during the kernel's suspend/resume cycle. > > > > This is needed so that we properly really

[PATCHv2 6/6] arm64: Hook up the ZBOOT support as vmlinuz

2023-05-16 Thread Pingfan Liu
From: Jeremy Linton Add the previously defined _probe() and _usage() routines to the kexec file types table, and build the new module. It should be noted that this "vmlinuz" support reuses the "Image" support to actually load the resulting image after it has been decompressed to a temporary file

[PATCHv2 1/6] kexec: Change the image probe's prototype

2023-05-16 Thread Pingfan Liu
As more complicated kernel format occurs such as zboot, where the compressed kernel is stored as a payload. The straight forward decompression can not meet the demand. A new image probe method is expected to read in the kernel file and decide how to unfold the content by itself. This patch aims t

[PATCHv2 5/6] arm64: Add ZBOOT PE containing compressed image support

2023-05-16 Thread Pingfan Liu
From: Jeremy Linton The kernel EFI stub ZBOOT feature creates a PE that contains a compressed linux kernel image. The stub when run in a valid UEFI environment then decompresses the resulting image and executes it. Support these image formats with kexec as well to avoid having to keep an alterna

[PATCHv2 2/6] arm64: Fix some issues with zImage _probe()

2023-05-16 Thread Pingfan Liu
From: Jeremy Linton Current compilers note that fname will be null while attempting to print failures from strdup(). Further fix a memory leak caused by kernel_uncompressed_buf never being used/freed before the allocated block is replaced by the one returned by slurp_decompress_file(). Signed-o

[PATCHv2 3/6] arm64: Scatter the logic of reading of kernel file into each probe

2023-05-16 Thread Pingfan Liu
As more complicated capsule kernel format ,such as zboot, emerge, where the compressed kernel is stored as a payload. The straight forward decompression can not meet the demand. Therefore, let a probe method read in the kernel file and decide how to unfold the content by the method itself. Since

[PATCHv2 4/6] kexec/zboot: Add arch independent zboot support

2023-05-16 Thread Pingfan Liu
From: Jeremy Linton The linux kernel CONFIG_ZBOOT option creates self decompressing PE kernel images. So this means that kexec should have a generic understanding of the format which may be used by multiple arches. So lets add an arch independent validation and decompression routine. Signed-off

[PATCHv2 0/6] arm64: zboot support

2023-05-16 Thread Pingfan Liu
As more complicated capsule kernel format occurs like zboot, where the compressed kernel is stored as a payload. The straight forward decompression can not meet the demand. As the first step, on aarch64, reading in the kernel file in a probe method and decide how to unfold the content by the metho