incubator-nuttx/fs/tmpfs
fangxinyong bfeb73e850 fs/tmpfs: fix use after free issue
mmap establish a mapping address space that refer to a tmpfs file,
there are two issues:

1. if the tmpfs file is removed and a subsequent close(), tmpfs_close
will release the backend memory object, use after free errors occur
when operating the mapping memory. We add an extra reference to memory object,
memory will be released when there are no more mappings.

2. if unmap only a portion of the memory, fix the bug that adds another map.
Use realloc and shrink the mapping memory instead.

The fix pass LTP posix case mmap/10-1.c and mmap/12-1.c

Signed-off-by: fangxinyong <fangxinyong@xiaomi.com>
2023-08-02 22:57:28 -07:00
..
CMakeLists.txt build: add initial cmake build system 2023-07-08 13:50:48 +08:00
Kconfig
Make.defs
fs_tmpfs.c fs/tmpfs: fix use after free issue 2023-08-02 22:57:28 -07:00
fs_tmpfs.h