Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
jffs2
JFFS2文件系统挂载失败时处理上的漏洞
发布于 2013-08-26 17:03:19 浏览:2310
订阅该版
```c /* * RT-Thread DFS Interface for jffs2 */ static int dfs_jffs2_mount(struct dfs_filesystem* fs, unsigned long rwflag, const void* data) { unsigned index; struct cyg_mtab_entry * mte; int result; /* find a empty entry in partition table */ for (index = 0; index < DEVICE_PART_MAX; index ++) { if (device_partition[index].dev == RT_NULL) break; } if (index == DEVICE_PART_MAX) return -DFS_STATUS_ENOSPC; mte = rt_malloc(sizeof(struct cyg_mtab_entry)); if (mte == RT_NULL) return -DFS_STATUS_ENOMEM; mte->name = fs->path; mte->fsname = "jffs2"; mte->devname = NULL; /* note that, i use mte->data to store rtt's device * while, in jffs2_mount, mte->data will be copy into * s_dev in struct super_block, and mte->data will be * filled with jffs2_sb(see the source of jffs2_mount. */ mte->data = (CYG_ADDRWORD)fs->dev_id; device_partition[index].dev = RT_MTD_DEVICE(fs->dev_id); /* after jffs2_mount, mte->data will not be dev_id any more */ result = jffs2_mount(NULL, mte); if (result != 0) { return jffs2_result_to_dfs(result); } /* save this pointer */ device_partition[index].mte = mte; return 0; } ``` 此处文件系统挂载失败,有漏洞,需要在挂在失败时检查device_partition[index].dev 并在 ```c if (result != 0) { return jffs2_result_to_dfs(result); } ``` 时将已经找到的设备移除掉,否则下次挂载的时候,如果仅允许一个`partition table`就会挂载不成功 [s:186]
查看更多
3
个回答
默认排序
按发布时间排序
bernard
2013-08-26
这家伙很懒,什么也没写!
谢谢指出。
prife
2013-08-26
这家伙很懒,什么也没写!
谢谢指出。
撰写答案
登录
注册新账号
关注者
0
被浏览
2.3k
关于作者
haitao52198
这家伙很懒,什么也没写!
提问
42
回答
260
被采纳
0
关注TA
发私信
相关问题
1
jffs2编译不过,jffs2已经不支持了吗?
2
simulator工程了修改JFFS2文件系统的大小
3
JFFS2文件系统open完偶尔flag不正确的BUG
4
关于jffs2文件系统的三个问题
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
RT-Thread动态模块
2
RT-Thread项目助手v0.3 | Ubuntu与MacOS平台的RT-Thread Env
3
【FRA156测评DM-MCX】- 环境配置篇
4
【基于HPM6750+RW007的网页服务器】---SD卡文件系统
5
有关RT_thread studio使用WDT的一点经验
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
rt-smart
RTC
FAL
I2C_IIC
ESP8266
UART
cubemx
WIZnet_W5500
ota在线升级
PWM
BSP
flash
freemodbus
packages_软件包
潘多拉开发板_Pandora
GD32
定时器
ADC
flashDB
编译报错
socket
中断
rt_mq_消息队列_msg_queue
Debug
keil_MDK
SFUD
msh
ulog
C++_cpp
MicroPython
本月问答贡献
lchnu
3
个答案
2
次被采纳
张世争
1
个答案
2
次被采纳
a1012112796
9
个答案
1
次被采纳
三世执戟
8
个答案
1
次被采纳
聚散无由
5
个答案
1
次被采纳
本月文章贡献
jinchanchan
9
篇文章
13
次点赞
ssdd45555
3
篇文章
2
次点赞
聚散无由
1
篇文章
4
次点赞
rvcore
1
篇文章
1
次点赞
lvdongchina
1
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部