nuttx/fs
ligd 0d365f6fb9 epoll: fix epoll close error, report by kasan
-#9  0xf7abf899 in __asan::__asan_report_load2 (addr=4072681776) at ../../../../../src/libsanitizer/asan/asan_rtl.cc:117
-#10 0x5693f718 in inode_release (node=0xf2c03124) at inode/fs_inoderelease.c:69
-#11 0x568ea61b in file_close (filep=0xf55fedd0) at vfs/fs_close.c:79
-#12 0x568e7e56 in nx_close (fd=3) at inode/fs_files.c:528
-#13 0x568e7f0e in close (fd=3) at inode/fs_files.c:562
-#14 0x56e76c39 in epoll_close (epfd=3) at vfs/fs_epoll.c:252
-#15 0x56c33829 in sensor_service_delete (ctrl=0x578b8540 <control>) at src/common.c:439
-#16 0x56a0561e in sensor_middle_service_main (argc=1, argv=0xf55de820) at sensor_main.c:118
-#17 0x56878675 in nxtask_startup (entrypt=0x56a054cc <sensor_middle_service_main>, argc=1, argv=0xf55de820) at sched/task_startup.c:70
-#18 0x5684427a in nxtask_start () at task/task_start.c:133
-#19 0xdeadbeef in ?? ()

reason:
epoll_close -> close -> epoll_do_close (free inode)
                     -> inode_release  (reuse inode, crash)

fix:
use the global inode to match the fd which will return to user.
like the g_sock_inode in fs/socket/socket.c

Signed-off-by: ligd <liguiding1@xiaomi.com>
2022-03-27 08:51:21 +03:00
..
aio pid_t: unify usage of special task IDs 2022-03-22 21:22:32 +08:00
binfs nuttx:Change fs strncpy to strlcpy to avoid losing'\0' 2021-12-30 18:06:00 +08:00
cromfs nuttx:Change fs strncpy to strlcpy to avoid losing'\0' 2021-12-30 18:06:00 +08:00
dirent nuttx:Change fs strncpy to strlcpy to avoid losing'\0' 2021-12-30 18:06:00 +08:00
driver nuttx:Change fs strncpy to strlcpy to avoid losing'\0' 2021-12-30 18:06:00 +08:00
fat fs/fat: Change the default value of FAT_MAXFNAME to NAME_MAX 2022-03-10 19:46:01 +02:00
hostfs nuttx:Change fs strncpy to strlcpy to avoid losing'\0' 2021-12-30 18:06:00 +08:00
inode pid_t: unify usage of special task IDs 2022-03-22 21:22:32 +08:00
littlefs nuttx:Change fs strncpy to strlcpy to avoid losing'\0' 2021-12-30 18:06:00 +08:00
mmap include: fix double include pre-processor guards 2022-01-16 11:11:14 -03:00
mount fs: Remove the unnecessary Kconfig definition 2022-02-05 23:58:01 +01:00
mqueue mqueue: Rename FS_MQUEUE_MPATH to FS_MQUEUE_VFS_PATH 2022-02-05 23:58:01 +01:00
nfs fs/nfs: fix compile warning 2022-03-19 02:20:20 +08:00
nxffs nuttx:Change fs strncpy to strlcpy to avoid losing'\0' 2021-12-30 18:06:00 +08:00
partition Fix an overflow in blkcnt_t gpt_last_lba 2022-01-19 15:58:35 +01:00
procfs mm/memdump: dynamic turn on backtrace in heap when enable DEBUG_MM 2022-03-27 13:21:48 +08:00
romfs fs/romfs: fix read file mismatch when the length of file name is 16 2022-03-01 11:44:27 -03:00
rpmsgfs rpmsgfs/rename: fix bug about pathname align with 8bytes 2022-03-27 05:16:13 +03:00
semaphore semaphore: Change FS_NAMED_SEMPATH from "/var/lock" to "/var/sem" 2022-02-05 23:58:01 +01:00
shm shm: Rename FS_SHMPATH to FS_SHM_VFS_PATH 2022-02-05 23:58:01 +01:00
smartfs Remove the double blank line from source files 2022-02-20 20:10:14 +01:00
socket file_operations: get back C89 compatible initializer 2022-01-11 02:14:00 +08:00
spiffs pid_t: unify usage of special task IDs 2022-03-22 21:22:32 +08:00
tmpfs nuttx:Change fs strncpy to strlcpy to avoid losing'\0' 2021-12-30 18:06:00 +08:00
unionfs nuttx:Change fs strncpy to strlcpy to avoid losing'\0' 2021-12-30 18:06:00 +08:00
userfs net: use HTONS, NTOHS, HTONL, NTOHL macro in kernel code 2022-01-18 10:59:47 +01:00
vfs epoll: fix epoll close error, report by kasan 2022-03-27 08:51:21 +03:00
fs_initialize.c Author: Gregory Nutt: update licenses to Apache 2021-02-05 12:15:56 -03:00
Kconfig Simplify DEFAULT_SMALL usage in Kconfig 2022-03-01 03:15:01 +08:00
Makefile fs/vfs: Add file descriptor based timers support 2021-12-20 04:00:20 -06:00