nuttx-mirror/fs
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
..
aio fs: remove sched_[un]lock 2023-08-01 23:15:37 +02:00
binfs build: add initial cmake build system 2023-07-08 13:50:48 +08:00
cromfs build: add initial cmake build system 2023-07-08 13:50:48 +08:00
driver cmake/build: fix build break on cmake 2023-07-25 15:00:10 +02:00
fat Kconfig: Simplify the conditional default statement 2023-07-16 14:39:20 -03:00
hostfs build: add initial cmake build system 2023-07-08 13:50:48 +08:00
inode fs/pseudofile: config pseudofile feature 2023-07-31 22:22:58 -07:00
littlefs build: add initial cmake build system 2023-07-08 13:50:48 +08:00
mmap fs/mmap: only MAP_SHARED mapping need file write permisson 2023-08-02 22:57:28 -07:00
mount build: add initial cmake build system 2023-07-08 13:50:48 +08:00
mqueue fs: remove sched_[un]lock 2023-08-01 23:15:37 +02:00
nfs fs/nfs: fix coding style issue 2023-07-31 21:41:30 -07:00
nxffs Fix nuttx coding style 2023-07-11 23:32:17 +08:00
partition TXTABLE: Support backup table 2023-07-29 20:27:10 -07:00
procfs fs: remove sched_[un]lock 2023-08-01 23:15:37 +02:00
romfs fs/romfs: Fix FIOC_FILEPATH for dup'ed file 2023-08-02 06:12:25 -07:00
rpmsgfs cmake/build: fix build break on cmake 2023-07-25 15:00:10 +02:00
semaphore fs: remove sched_[un]lock 2023-08-01 23:15:37 +02:00
shm mm/map: limit the count of memory mapping for the task 2023-08-02 22:57:28 -07:00
smartfs build: add initial cmake build system 2023-07-08 13:50:48 +08:00
socket build: add initial cmake build system 2023-07-08 13:50:48 +08:00
spiffs Fix nuttx coding style 2023-07-11 23:32:17 +08:00
tmpfs fs/tmpfs: fix use after free issue 2023-08-02 22:57:28 -07:00
unionfs fs/unionfs: Remove unionfs_mount function 2023-07-30 18:51:26 -03:00
userfs build: add initial cmake build system 2023-07-08 13:50:48 +08:00
vfs fs/vfs: ftruncate produce EINVAL if fd is not open for writing 2023-08-02 22:57:28 -07:00
CMakeLists.txt build: add initial cmake build system 2023-07-08 13:50:48 +08:00
fs_initialize.c fs: Flush the file system cache in BOARDIOC_POWEROFF too 2023-04-21 20:37:59 +03:00
Kconfig fs/pseudofile: config pseudofile feature 2023-07-31 22:22:58 -07:00
Makefile Minor style clean up 2023-01-28 19:53:20 +02:00