walnux/fs
dulibo1 3c866e8cfd procfs:fix cat dir cause crash
ap> cat pm
=================================================================
==30235==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf436edd9 at pc 0x03338a48 bp 0x9d1b6ca8 sp 0x9d1b6c98
READ of size 1 at 0xf436edd9 thread T0
    #0 0x3338a47 in strncmp string/lib_strncmp.c:42
    #1 0x371af87 in pm_get_file_index power/pm/pm_procfs.c:174
    #2 0x371b066 in pm_open power/pm/pm_procfs.c:207
    #3 0x3640d20 in procfs_open procfs/fs_procfs.c:419
    #4 0x359bce2 in file_vopen vfs/fs_open.c:240
    #5 0x359c431 in nx_vopen vfs/fs_open.c:312
    #6 0x359cb53 in open vfs/fs_open.c:465
    #7 0x33bccc9 in nsh_catfile /apps/nshlib/nsh_fsutils.c:140
    #8 0x33b28cc in cmd_cat /apps/nshlib/nsh_fscmds.c:556
    #9 0x33a434f in nsh_command /apps/nshlib/nsh_command.c:1164
    #10 0x3381b8f in nsh_execute /apps/nshlib/nsh_parse.c:845
    #11 0x338dc17 in nsh_parse_command /apps/nshlib/nsh_parse.c:2744
    #12 0x338e273 in nsh_parse /apps/nshlib/nsh_parse.c:2828
    #13 0x3390b47 in nsh_session /apps/nshlib/nsh_session.c:245
    #14 0x337e90a in nsh_consolemain /apps/nshlib/nsh_consolemain.c:75
    #15 0x337e7f7 in nsh_main /apps/system/nsh/nsh_main.c:74
    #16 0x332b6e6 in nxtask_startup sched/task_startup.c:70
    #17 0x323ec3f in nxtask_start task/task_start.c:134
    #18 0x33636ea in pre_start sim/sim_initialstate.c:52

ap> cat net
=================================================================
==30303==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf4479a5a at pc 0x03338a48 bp 0x9d2b6ce8 sp 0x9d2b6cd8
READ of size 1 at 0xf4479a5a thread T0
    #0 0x3338a47 in strncmp string/lib_strncmp.c:42
    #1 0x5395d62 in netprocfs_open procfs/net_procfs.c:215
    #2 0x3640d20 in procfs_open procfs/fs_procfs.c:419
    #3 0x359bce2 in file_vopen vfs/fs_open.c:240
    #4 0x359c431 in nx_vopen vfs/fs_open.c:312
    #5 0x359cb53 in open vfs/fs_open.c:465
    #6 0x33bccc9 in nsh_catfile /apps/nshlib/nsh_fsutils.c:140
    #7 0x33b28cc in cmd_cat /apps/nshlib/nsh_fscmds.c:556
    #8 0x33a434f in nsh_command /apps/nshlib/nsh_command.c:1164
    #9 0x3381b8f in nsh_execute /apps/nshlib/nsh_parse.c:845
    #10 0x338dc17 in nsh_parse_command /apps/nshlib/nsh_parse.c:2744
    #11 0x338e273 in nsh_parse /apps/nshlib/nsh_parse.c:2828
    #12 0x3390b47 in nsh_session /apps/nshlib/nsh_session.c:245
    #13 0x337e90a in nsh_consolemain /apps/nshlib/nsh_consolemain.c:75
    #14 0x337e7f7 in nsh_main /apps/system/nsh/nsh_main.c:74
    #15 0x332b6e6 in nxtask_startup sched/task_startup.c:70
    #16 0x323ec3f in nxtask_start task/task_start.c:134
    #17 0x33636ea in pre_start sim/sim_initialstate.c:52

Signed-off-by: dulibo1 <dulibo1@xiaomi.com>
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
2024-09-27 23:19:57 +08:00
..
aio vfs/file: add reference counting to prevent accidental close during reading writing... 2024-09-17 12:01:53 +08:00
binfs nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
cromfs nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
driver nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
fat nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
hostfs fs/hostfs: Replace strcpy with memcpy 2024-09-06 12:27:55 +08:00
inode Should call fs_putfilep put fs reference when call files_fget complete 2024-09-23 18:22:35 +08:00
littlefs add sched note for littlefs/romfs/rpmsgfs 2024-09-17 15:21:54 -03:00
mmap fs_rammap:Check last fileseek restore fpos 2024-09-26 16:15:17 +08:00
mnemofs boards/sim: Defconfigs for nand and mnemofs 2024-09-05 11:02:05 +08:00
mount fs_inode:Change the type of i_crefs to atomic_int 2024-09-23 14:07:03 +08:00
mqueue fs_inode:Change the type of i_crefs to atomic_int 2024-09-23 14:07:03 +08:00
nfs fs: nfs: Fix nfsmount error 2024-08-27 21:57:18 +08:00
notify nuttx/atomic.h:fix Fixed the pragma of ATOMIC_VAR_INIT in clang 2024-09-23 14:07:03 +08:00
nxffs nuttx: resolve various 'FAR' and 'CODE' issues 2024-08-26 10:21:03 +08:00
partition fs: partition: fs_mbr: fix for MBR block count calculation. 2024-01-14 01:29:24 -08:00
procfs procfs:fix cat dir cause crash 2024-09-27 23:19:57 +08:00
romfs add sched note for littlefs/romfs/rpmsgfs 2024-09-17 15:21:54 -03:00
rpmsgfs add sched note for littlefs/romfs/rpmsgfs 2024-09-17 15:21:54 -03:00
semaphore fs_inode:Change the type of i_crefs to atomic_int 2024-09-23 14:07:03 +08:00
shm fs_inode:Change the type of i_crefs to atomic_int 2024-09-23 14:07:03 +08:00
smartfs smartfs: add support for FIOC_FILEPATH ioctl 2024-09-27 10:28:37 +08:00
socket nuttx/atomic.h:fix Fixed the pragma of ATOMIC_VAR_INIT in clang 2024-09-23 14:07:03 +08:00
spiffs nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
tmpfs fs: add fs_heap, support shm/tmpfs/pseudofile with indepent heap 2024-08-25 22:12:37 +08:00
unionfs nuttx: fix multiple 'FAR', 'CODE' and style issues 2024-08-25 19:22:15 +08:00
userfs fs: procfs add poll support 2023-12-26 19:23:13 -08:00
v9fs Fix Kconfig style 2024-09-17 22:16:41 +08:00
vfs fs_fcntl: fix the ret value not check error 2024-09-27 00:20:53 +08:00
zipfs fs: procfs add poll support 2023-12-26 19:23:13 -08:00
CMakeLists.txt fs: add fs_heap, support shm/tmpfs/pseudofile with indepent heap 2024-08-25 22:12:37 +08:00
fs_heap.c fs: add fs_heap, support shm/tmpfs/pseudofile with indepent heap 2024-08-25 22:12:37 +08:00
fs_heap.h fs: add fs_heap, support shm/tmpfs/pseudofile with indepent heap 2024-08-25 22:12:37 +08:00
fs_initialize.c fs: add fs_heap, support shm/tmpfs/pseudofile with indepent heap 2024-08-25 22:12:37 +08:00
Kconfig Add reference count configuration 2024-09-17 12:01:53 +08:00
Makefile Revert "build depend:Revert Make.dep intermediate ddc file" 2024-09-15 19:29:47 +08:00