Commit Graph

611 Commits

Author SHA1 Message Date
Shell 91fc52df36 fixup: merge condition 2023-10-25 18:40:44 +08:00
Shell e94b759160 [quality] fixup: vulnerability in kernel
including out-of-bound access in dfs, and use-after-free in
aspace_traversal

Signed-off-by: Shell <smokewood@qq.com>
2023-10-25 18:40:44 +08:00
Shell fb78a71020
[smart] replace varea pgmgr and fixup of dfs mmap (#8184)
Signed-off-by: shell <smokewood@qq.com>
Signed-off-by: Shell <smokewood@qq.com>
2023-10-25 14:59:48 +08:00
xiao-mang 3c7b184f93 add exfat config 2023-10-24 18:02:02 +08:00
xiao-mang 93f350ae1f add exfat config 2023-10-24 18:02:02 +08:00
xiao-mang d3aa7406ed add exfat config 2023-10-24 18:02:02 +08:00
xiao-mang 117d1f6324 add exfat config 2023-10-24 18:02:02 +08:00
shell b40d106bdc [dfs] fixup: file_mmap and page cache
Including cache maintenance, potential dereference of null pointer and
the use-after-free issue in page cache

Signed-off-by: shell <smokewood@qq.com>
2023-10-24 14:49:30 +08:00
xiao-mang 90c7089d47
fix ash echo (#8150) 2023-10-21 08:41:55 +08:00
XYZ 1f05b6b401
[dfs v2] support O_DIRECT and O_SYNC flags (#8155) 2023-10-20 13:24:56 +08:00
geniusgogo ecd29fda60
Sync dfs lwp (#8123) 2023-10-17 13:07:59 +08:00
xqyjlj 1e0f406b4f
feat(dfs_v2/cromfs): add symlink support (#8132) 2023-10-17 09:55:28 +08:00
xiao-mang 5d16042765
add sys_utimensat (#8124) 2023-10-13 19:21:49 +08:00
xqyjlj e5c5ec4b2a
🐞 fix(dfs_v2/filesystems/elmfat): fix elm can not exec (#8118) 2023-10-09 13:26:58 +08:00
zhouminquan 75b4f3d83a tmpfs adds truncate functionality and unlink adaptations 2023-09-25 13:23:25 +08:00
xiao-mang 12592458b9
fix tar -xzvf symbol link (#8034) 2023-09-14 11:29:03 +08:00
geniusgogo d5b8e2843a
fix dfsv2 tmpfs lock fault. (#8027) 2023-09-13 10:37:00 +08:00
蒙蒙plus 0391b81bb5
Update dfs_tmpfs.c (#8030) 2023-09-12 21:04:21 +08:00
XYZ 012aa117af
[fix] copyfile dest file empty first (#8012) 2023-09-09 22:08:00 +08:00
XYZ 3602f89121
[smart][dfs v2] add cromfs (#7994)
Co-authored-by: xyz <xyz@rtt.com>
2023-09-01 00:20:55 +08:00
Junjie Wang 166c83f372
[DFS_V1]修复 dfs_file_stat 一个 FATFS 根目录会失败的问题 (#7940) 2023-08-20 08:46:09 +08:00
Meco Man b08d8672d2 [libc][posix/io/stdio] rename libc.c as posix/stdio.c 2023-08-17 02:22:53 -04:00
Shell d862816a51
[components/mm] add unmap page API (#7834)
Signed-off-by: Shell <smokewood@qq.com>
2023-08-16 15:38:59 +08:00
geniusgogo 1b5ed06d38
fix mkdir error code. (#7944) 2023-08-12 10:50:15 +08:00
geniusgogo deb0b031fc
fix dfs_file_open error code (#7942) 2023-08-12 10:49:26 +08:00
Junjie Wang b3831246c2
[DFS_V1] 修复close失败后不释放fd导致内存被永久占用且无法释放 (#7907) 2023-08-03 15:42:54 +08:00
geniusgogo 69d94315b8
update dfs (#7887) 2023-08-02 13:59:43 +08:00
Tennn11 fb1faa0746
[dfs v2]fix fcntl(F_SETFL) bug,and modify the error code when opening… (#7878) 2023-07-27 17:23:39 +08:00
zhkag 7e5620edc3
[smart] 修复用户态 mq_receive 不能阻塞 (#7836) 2023-07-24 17:01:45 +08:00
xiao-mang befa951451
modify some function prototypes of the dfs_file_ops structure and the function declarations based on it (#7849) 2023-07-24 09:12:35 +08:00
zhkag d6adf6708f
[posix] posix 的 mqueue 对接到文件系统的 fd (#7768) 2023-07-05 14:49:31 +08:00
zhkag 7b4e52bd79
[DFS_V2]Update dfs_elm.c 修复变量使用错误 (#7776) 2023-07-04 20:56:37 +08:00
yangfasheng b4e59bac4e
dfs v2 修改 fd_new 的 startfd 起始值为 0 ;修复 futex_wait 超时时间换算异常; (#7705)
Signed-off-by: yangfasheng <yangfasheng@live.com>
2023-06-20 23:09:58 +08:00
yangfasheng e36b97ff94
[dfs v2] fix dentry hash lookup bug; update dentry dump msh cmd; (#7655)
Signed-off-by: yangfasheng <yangfasheng@live.com>
2023-06-11 18:07:06 +08:00
Bernard Xiong cd3f0f9c8a
Add color ls for executable file. (#7654) 2023-06-11 13:12:40 +08:00
Bernard Xiong 99e80f8d33
[dfs] Add DFS v2.0 (#7606) 2023-06-10 21:35:25 +08:00
geniusgogo de567b8fb3 fixed dfsv2 openat. 2023-05-16 18:21:24 +08:00
geniusgogo 0e4a3142a8
[component] add openat syscall. (#7488) 2023-05-15 20:40:27 +08:00
goldengrandpa efbdeb25ee
[dfs]释放fd_slot之前将子节点释放避免内存泄漏 (#7378) 2023-04-26 08:47:21 +08:00
Xu Biang 2c98ce4605
[HUST CSE][document] Fix some comments, invalid grouping commands and warnings in Doxygen.
将Doxygen输入文件(由Doxyfile中的INPUT定义)中的失效Doxygen分组指令(如/*@*/和/*@}*/)更改为有效的分组指令(如/**@*/和/**@}*/);(此处只对INPUT中的文件做了修改,bsp目录下和libcpu目录下存在近万个失效的Doxygen分组指令,但由于不作为文档的输入文件且这些文件过于庞大老旧,没有对这些文件中的无效指令做修改)
将图片文件统一放入了images目录下;
修改了Doxyfile和部分Doxygen注释,使得Doxyfile能够定位到新的代码路径且不受重复实现的影响;
解决了一些注释中的参数名不匹配、参数多余/缺失等问题。
2023-04-14 12:33:43 -04:00
geniusgogo 5bbcb5dc79
fix tmpfs spinlock error. (#7216) 2023-04-12 13:12:27 +08:00
Bernard Xiong 9600b75b55
[DFS] prepare for dfs_v2.0 (#7200)
* [DFS] prepare for dfs_v2. dfs_fd -> dfs_file; dfs_fnode -> dfs_vnode.

* [BSP] fix code analysis warning

* [smart] fix the pointer overflow.

* code format

* [smart] fix the lwp->lwp_obj checking.
2023-04-08 22:25:51 +08:00
geniusgogo 3ea1ce9e46
Fix nfs (#7194)
* fixed nfs 64bit arch fault

* change mount cmd support nfs.
2023-04-08 12:22:19 +08:00
Bernard Xiong 23955edf53
[DFS] add Kconfig for dfs-v2.0 (#7156)
* [DFS] add Kconfig for dfs-v2.0

* [DFS] Optimize the SConscript.

* [dfs] move old dfs to dfs/dfs_v1
2023-04-04 15:02:56 +08:00
xqyjlj d6e40f2a24 feat(components/dfs/filesystems/tmpfs/dfs_tmpfs.c): add f_bavail support 2023-03-31 10:56:37 +08:00
xqyjlj 7fb8f61756 feat(components/dfs/filesystems/devfs/devfs.c): add statfs support 2023-03-31 10:56:37 +08:00
xqyjlj cd1e0a7901 feat(components): add statfs, statfs64, fstatfs, fstatfs64 support 2023-03-31 10:56:37 +08:00
xqyjlj 954f1d9b63 🐞 fix(components/dfs/src/dfs_posix.c): use stat to implement fstat 2023-03-31 10:56:37 +08:00
zhkag f2dd21ccee 对 /dev 目录做特殊处理 2023-03-29 15:31:46 +08:00
xqyjlj eb0df6b12c
feat(components/dfs/filesystems/elmfat/dfs_elm.c): add st_blocks su… (#7091) 2023-03-25 07:34:00 +08:00
Shell fcc01a617d
[rt-smart] Fix return value in syscall (#7045)
* [timer] fix sys return value to avoid outdated errno

* [rtdef] add wrap to stringify

* [syscall] return value in rt errno should be recycle immediately after call to posix layer

* [syscall] return type of syscall should be long
errno should be recycle immediately after call to rt posix layer to avoid
outdated value

* [format] move prototype to header file

* [fix] futex definition conflict
2023-03-13 19:09:34 +08:00
xqyjlj 312eb0c412 🌈 style(components/dfs/filesystems/tmpfs/dfs_tmpfs.c): fix style 2023-02-07 11:31:15 +08:00
xqyjlj da8f5c08c2 🐞 fix(components/dfs/filesystems/tmpfs/dfs_tmpfs.c): cannot open the same file repeatedly in 'w' mode 2023-02-07 11:31:15 +08:00
guo 68ca9f07a6
[rt-smart] 弱化 RT_USING_LWP,使用 RT_USING_SMART 作为宏配置 (#6740)
* [dfs] sync cromfs

* [rt-smart]Weaken RT_USING_LWP, use RT_USING_SMART as macro configuration

* [format] fix some format issue.
2022-12-16 18:38:28 +08:00
褚仕成 4246275e6e add "\n" to cat 2022-12-15 11:34:00 -05:00
guo 0bc01ad0d9
[dfs] sync cromfs (#6739) 2022-12-14 22:28:34 +08:00
Man, Jianting (Meco) 99bdf978d7
[rtdef] use lower-case to define attributes (#6728)
* [rtdef] rename RT_WEAK attribute as rt_weak

* [rtdef] rename RT_USED attribute as rt_used

* [rtdef] rename RT_SECTION attribute as rt_section

* [rtdef] rename ALIGN attribute as rt_align

* [legacy] add RT_USED ALIGN RT_SECTION RT_WEAK as legacy support
2022-12-11 13:12:03 -05:00
guo ecf2d82159
sync branch rt-smart. (#6641)
* Synchronize the code of the rt mart branch to the master branch.
  * TTY device
  * Add lwP code from rt-smart
  * Add vnode in DFS, but DFS will be re-write for rt-smart
  * There are three libcpu for rt-smart:
    * arm/cortex-a, arm/aarch64
    * riscv64

Co-authored-by: Rbb666 <zhangbingru@rt-thread.com>
Co-authored-by: zhkag <zhkag@foxmail.com>
2022-12-03 12:07:44 +08:00
Man, Jianting (Meco) bdd663a33f
[libc][musl] support arm-linux-musleabi toolchain
目前基本功能已经可以在QEMU上跑起来,但是pthread和内核signal选中会报冲突。先合并一版本,后续解决这些问题。
2022-11-22 21:40:50 -05:00
Meco Man 84eab69604 [msh] remove list_xxx commands, use 'list' to replace 2022-11-21 21:39:45 -05:00
a1012112796 5370d4da50 replace `rt_enter_critical` with `dfs_lock` for list_fd
I found that if use mutex in `rt_kprintf`,
the `rt_enter_critical` will create a assert
error later. after chehcking,I found all
operation with fd_table has using
`dfs_lock/unlock` to protect. so I think
using `dfs_lock` is enough. thanks.

Signed-off-by: a1012112796 <1012112796@qq.com>
2022-11-09 22:41:15 -05:00
winfenggao 74fd07a565
lseek()函数中,当seek到文件的位置和当前位置相同时,不需要调用dfs_file_lseek()函数,直接返回当前位置即可。 (#6498)
当seek到文件的位置和当前位置相同时,不需要调用dfs_file_lseek()函数,直接返回当前位置即可。
同时,以lseek(fd,0,SEEK_CUR)的方式执行函数可以返回文件当前读去位置,可以实现
ftell()的功能.
以lseek(fd,0,SEEK_CUR)的方式执行函数返回文件当前位置,实现ftell()的功能时不用调用dfs_file_lseek()函数,提高效率;seek(fd,0,SEEK_CUR)本来就能返回当前位置。
2022-10-10 17:48:02 -04:00
Tangyuxin a4829b1c00
[fix] Fix simulator compilation warnings (#6438)
* [fix] Fix simulator compilation warnings

* Update bsp/simulator/rtconfig_project.h

Co-authored-by: Man, Jianting (Meco) <920369182@qq.com>
2022-09-20 10:31:11 -04:00
dongly 3363586cbb
Fix some compilation warning (#5744)
* Fix some compilation warning

* 补充修正一些数据类型的使用错误

Co-authored-by: Meco Man <920369182@qq.com>
2022-08-02 12:09:49 -04:00
Man, Jianting (Meco) 2c10d5ad01
[rtc] use gmtime_r to replace gmtime (#6012)
* [rtc] use gmtime_r to replace gmtime
2022-06-22 13:41:06 +08:00
Bernard Xiong 1aab3607af
Revert "[dfs][romfs]支持相对地址模式 (#5768)" (#5786)
This reverts commit e68f934ff8.
2022-04-08 20:03:43 +08:00
Tangyuxin e68f934ff8
[dfs][romfs]支持相对地址模式 (#5768) 2022-04-06 21:13:12 +08:00
a1012112796 961fe7de0b
list_fd 显示完整路径 (#5683) 2022-03-26 15:45:53 +08:00
Man, Jianting (Meco) a514b3bd16
[components][kconfig] 整理Kconfig目录名称和结构 (#5698) 2022-03-25 23:07:18 +08:00
guozhanxin 9b44535740 add RT_DEBUG_SCHEDULER_AVAILABLE check 2022-01-26 16:03:31 +08:00
Meco Man add72f1d7c [dfs][posix] add creat() 2022-01-20 20:50:24 +08:00
liukangcc 3d2e23ec1c [update] move dfs_posix.h to legacy/dfs/dfs_posix.h 2022-01-14 23:09:32 +08:00
Meco Man f89a162ea3 [core] 使用rt_memcpy rt_memset代替memcpy memset 2022-01-09 00:23:18 +08:00
Meco Man 918ee6147c add RT_USING_POSIX_STDIO 2022-01-05 23:11:58 +08:00
Meco Man ed09f38012 [libc] remove RT_USING_LIBC 2021-12-30 01:27:25 +08:00
Meco Man 7c789d4b11 revise some RT_USING_POSIX to RT_USING_POSIX_DEVIO 2021-11-24 09:47:55 -05:00
Meco Man a3284876ff revise RT_USING_POSIX_STDIO to RT_USING_POSIX_DEVIO 2021-11-24 08:41:10 -05:00
Bernard Xiong f11113f557
Merge pull request #5277 from mysterywolf/compatibility
implement legacy support
2021-11-24 17:37:25 +08:00
Bernard Xiong 64023c38f7
Merge pull request #5283 from mysterywolf/dfs
[dfs] move dfs back
2021-11-24 17:37:03 +08:00
Meco Man df9a23c534 [mutex] use RT_IPC_FLAG_PRIO to replace RT_IPC_FLAG_FIFO 2021-11-17 15:57:15 -05:00
Meco Man 973f25901c [dfs] move dfs back 2021-11-16 00:57:56 -05:00
Meco Man c6c1544c84 implement legacy support 2021-11-14 23:51:05 -05:00
Meco Man 2b7d12661e remove RT_USING_LIBC from dfs_fs.h 2021-11-09 18:40:53 -05:00
Meco Man f8388c572e add RT_USING_POSIX_STDIO 2021-11-07 23:41:16 -05:00
Jianting (Meco) Man 702b91c3ce [dfs] 保留dfs_poll.h dfs_select.h,加warning提示 2021-10-27 23:44:46 -04:00
guo bb859e79e0
Merge pull request #5223 from cndabai/fatfs
update fatfs to the latest version
2021-10-27 18:24:37 +08:00
guo 4107d7bea2
Merge pull request #5236 from mysterywolf/posix
[libc][posix] 解决RT_LIBC_USING_FILEIO范围过大的问题
2021-10-27 18:06:54 +08:00
Meco Man 25bd908fb7 [libc][posix] 解决RT_LIBC_USING_FILEIO范围过大的问题 2021-10-27 03:04:05 -04:00
guo 3f4eead5a7
Merge pull request #5199 from mysterywolf/removeselectpoll
[dfs] remove dfs_select.h and dfs_poll.h
2021-10-27 13:58:31 +08:00
Meco Man a9910a780e [posix][libc] 优化libc中posix结构 2021-10-26 23:09:54 -04:00
mazhiyuan 3c964519b6 [fatfs]update .ignore_format.yml 2021-10-25 16:58:27 +08:00
mazhiyuan 92ee14ff7a update ff.c/h 2021-10-25 14:41:50 +08:00
mazhiyuan 41af944949 update ffconf.h 2021-10-25 14:10:58 +08:00
mazhiyuan 39933d7305 update ffconf.h 2021-10-25 13:58:07 +08:00
mazhiyuan ecd84844c5 update fatfs to the latest version 2021-10-25 11:41:34 +08:00
Meco Man f7548b934e [posix][dfs] move dfs_posix dfs_poll dfs_select.c to posix folder 2021-10-21 19:05:53 -04:00
Meco Man 20924ea3f5 [dfs] remove dfs_select.h and dfs_poll.h 2021-10-17 17:16:59 -04:00
Jianting (Meco) Man 8c01acc667
Revert "[libc]&[dfs] remove unnecessary RT_USING_POSIX and RT_USING_DFS_DEVFS" 2021-10-14 20:11:01 -04:00
Meco Man a354f846e8 [libc]&[dfs] remove unnecessary RT_USING_POSIX and RT_USING_DFS_DEVFS 2021-10-13 15:21:41 -04:00
tangyuxin 08e5e9d25f [bsp][simulator] Fix compilation errors 2021-10-11 20:09:47 +08:00