Skip to content

Commit

Permalink
decompress: Use 8 byte alignment
Browse files Browse the repository at this point in the history
commit 8217ad0 upstream.

The ZSTD decompressor requires malloc() allocations to be 8 byte
aligned, so ensure that this the case.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20230807162720.545787-19-ardb@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
ardbiesheuvel authored and gregkh committed Mar 6, 2024
1 parent 5c4fead commit bf0ca98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/decompress/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ MALLOC_VISIBLE void *malloc(int size)
if (!malloc_ptr)
malloc_ptr = free_mem_ptr;

malloc_ptr = (malloc_ptr + 3) & ~3; /* Align */
malloc_ptr = (malloc_ptr + 7) & ~7; /* Align */

p = (void *)malloc_ptr;
malloc_ptr += size;
Expand Down

0 comments on commit bf0ca98

Please sign in to comment.