zephyr/lib/os
Andy Ross d0490fe9f9 lib/os/mempool: Fix corruption case with block splitting
The block_fits() predicate was borked.  It would check that a block
fits within the bounds of the whole heap.  But that's not enough:
because of alignment changes between levels the sub-blocks may be
adjusted forward.  It needs to fit inside the PARENT block that it was
split from.

What could happen at runtime is that the last subblocks of a
misaligned parent block would overlap memory from subsequent blocks,
or even run off the end of the heap.  That's bad.

Change the API of block_fits() a little so it can extract the parent
region and do this properly.

Fixes #15279.  Passes test introduced in #16728 to demonstrate what
seems like the same issue.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-06-25 18:51:08 -07:00
..
assert.c misc: assert_post_action: Added __weak keyword. 2019-03-02 12:26:21 -05:00
base64.c all: Add 'U' suffix when using unsigned variables 2019-03-28 17:15:58 -05:00
CMakeLists.txt license: cleanup: add SPDX Apache-2.0 license identifier 2019-04-07 08:45:22 -04:00
crc7_sw.c lib: flatten all loose components into one lib 2019-01-22 07:45:22 -05:00
crc8_sw.c lib: flatten all loose components into one lib 2019-01-22 07:45:22 -05:00
crc16_sw.c all: Update unsigend 'U' suffix due to multiplication 2019-03-28 17:15:58 -05:00
crc32_sw.c lib: flatten all loose components into one lib 2019-01-22 07:45:22 -05:00
fdtable.c net: sockets: move fcntl back to socket_offload.c 2019-03-20 11:36:18 -05:00
json.c json: make it 64-bit compatible 2019-06-05 07:47:41 -04:00
Kconfig lib: flatten all loose components into one lib 2019-01-22 07:45:22 -05:00
mempool.c lib/os/mempool: Fix corruption case with block splitting 2019-06-25 18:51:08 -07:00
mutex.c lib: os: add sys_mutex data type 2019-04-03 13:47:45 -04:00
printk.c printk: make it 64-bit compatible 2019-06-17 10:28:44 -07:00
rb.c lib: rb: Make operands have an appropriate essential type 2019-03-26 22:06:45 -04:00
ring_buffer.c lib: os: ring_buffer: Fix not handled return value 2019-03-14 08:40:18 +01:00
thread_entry.c lib: os: remove dead code 2019-06-18 09:08:01 -04:00
work_q.c lib: flatten all loose components into one lib 2019-01-22 07:45:22 -05:00