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 Fix typos in comments and documentation (#750) 2020-04-08 06:45:35 -06:00
Make.defs Author: Gregory Nutt: update licenses to Apache 2021-02-05 12:15:56 -03:00
fs_tmpfs.c fs/tmpfs: fix use after free issue 2023-08-02 22:57:28 -07:00
fs_tmpfs.h fs: Add g_ prefix for all global mountpt_operations instances 2023-04-24 16:13:29 +02:00