]> git.ipfire.org Git - thirdparty/glibc.git/commit
Fix alignment bug in Safe-Linking
authorEyal Itkin <eyalit@checkpoint.com>
Tue, 31 Mar 2020 06:00:14 +0000 (02:00 -0400)
committerCarlos O'Donell <carlos@redhat.com>
Wed, 1 Apr 2020 01:48:54 +0000 (21:48 -0400)
commit49c3c37651e2d2ec4ff8ce21252bbbc08a9d6639
tree627252d100433cfb1bcd5a600077cbf7ab4d43f7
parent768358b6a80742f6be68ecd9f952f4b60614df96
Fix alignment bug in Safe-Linking

Alignment checks should be performed on the user's buffer and NOT
on the mchunkptr as was done before. This caused bugs in 32 bit
versions, because: 2*sizeof(t) != MALLOC_ALIGNMENT.

As the tcache works on users' buffers it uses the aligned_OK()
check, and the rest work on mchunkptr and therefore check using
misaligned_chunk().

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
malloc/malloc.c