Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
ca41a70d
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
大约 1 年 前同步成功
通知
456
Star
414
Fork
55
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos A
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ca41a70d
编写于
4月 10, 2021
作者:
O
openharmony_ci
提交者:
Gitee
4月 10, 2021
浏览文件
操作
浏览文件
下载
差异文件
!132 VfsJffs2Lookup中VfsHashGet获取的vnode未判断data字段的有效性
Merge pull request !132 from zhangfanfan2/jffs2
上级
9dd5d56f
ee8ae574
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
12 addition
and
13 deletion
+12
-13
arch/arm/arm/src/los_exc.c
arch/arm/arm/src/los_exc.c
+9
-13
fs/jffs2/src/vfs_jffs2.c
fs/jffs2/src/vfs_jffs2.c
+3
-0
未找到文件。
arch/arm/arm/src/los_exc.c
浏览文件 @
ca41a70d
...
@@ -574,12 +574,8 @@ STATIC VOID OsUserExcHandle(ExcContext *excBufAddr)
...
@@ -574,12 +574,8 @@ STATIC VOID OsUserExcHandle(ExcContext *excBufAddr)
PrintExcInfo
(
"User mode exception ends unscheduled!
\n
"
);
PrintExcInfo
(
"User mode exception ends unscheduled!
\n
"
);
}
}
/*
/* this function is used to validate fp or validate the checking range start and end. */
* This function is used to determine whether the first input parameter is a valid virtual address.
STATIC
INLINE
BOOL
IsValidFP
(
UINTPTR
regFP
,
UINTPTR
start
,
UINTPTR
end
,
vaddr_t
*
vaddr
)
* If it is, it is converted into a kernel virtual address and the converted kernel virtual address
* is used as an output parameter.
*/
STATIC
INLINE
BOOL
IsValidVaddr
(
UINTPTR
regFP
,
UINTPTR
start
,
UINTPTR
end
,
vaddr_t
*
vaddr
)
{
{
VADDR_T
kvaddr
=
regFP
;
VADDR_T
kvaddr
=
regFP
;
...
@@ -622,7 +618,7 @@ STATIC INLINE BOOL FindSuitableStack(UINTPTR regFP, UINTPTR *start, UINTPTR *end
...
@@ -622,7 +618,7 @@ STATIC INLINE BOOL FindSuitableStack(UINTPTR regFP, UINTPTR *start, UINTPTR *end
taskCB
=
OsCurrTaskGet
();
taskCB
=
OsCurrTaskGet
();
stackStart
=
taskCB
->
userMapBase
;
stackStart
=
taskCB
->
userMapBase
;
stackEnd
=
taskCB
->
userMapBase
+
taskCB
->
userMapSize
;
stackEnd
=
taskCB
->
userMapBase
+
taskCB
->
userMapSize
;
if
(
IsValid
Vaddr
(
regFP
,
stackStart
,
stackEnd
,
&
kvaddr
)
==
TRUE
)
{
if
(
IsValid
FP
(
regFP
,
stackStart
,
stackEnd
,
&
kvaddr
)
==
TRUE
)
{
found
=
TRUE
;
found
=
TRUE
;
goto
FOUND
;
goto
FOUND
;
}
}
...
@@ -638,7 +634,7 @@ STATIC INLINE BOOL FindSuitableStack(UINTPTR regFP, UINTPTR *start, UINTPTR *end
...
@@ -638,7 +634,7 @@ STATIC INLINE BOOL FindSuitableStack(UINTPTR regFP, UINTPTR *start, UINTPTR *end
stackStart
=
taskCB
->
topOfStack
;
stackStart
=
taskCB
->
topOfStack
;
stackEnd
=
taskCB
->
topOfStack
+
taskCB
->
stackSize
;
stackEnd
=
taskCB
->
topOfStack
+
taskCB
->
stackSize
;
if
(
IsValid
Vaddr
(
regFP
,
stackStart
,
stackEnd
,
&
kvaddr
)
==
TRUE
)
{
if
(
IsValid
FP
(
regFP
,
stackStart
,
stackEnd
,
&
kvaddr
)
==
TRUE
)
{
found
=
TRUE
;
found
=
TRUE
;
goto
FOUND
;
goto
FOUND
;
}
}
...
@@ -649,7 +645,7 @@ STATIC INLINE BOOL FindSuitableStack(UINTPTR regFP, UINTPTR *start, UINTPTR *end
...
@@ -649,7 +645,7 @@ STATIC INLINE BOOL FindSuitableStack(UINTPTR regFP, UINTPTR *start, UINTPTR *end
stack
=
&
g_excStack
[
index
];
stack
=
&
g_excStack
[
index
];
stackStart
=
(
UINTPTR
)
stack
->
stackTop
;
stackStart
=
(
UINTPTR
)
stack
->
stackTop
;
stackEnd
=
stackStart
+
LOSCFG_KERNEL_CORE_NUM
*
stack
->
stackSize
;
stackEnd
=
stackStart
+
LOSCFG_KERNEL_CORE_NUM
*
stack
->
stackSize
;
if
(
IsValid
Vaddr
(
regFP
,
stackStart
,
stackEnd
,
&
kvaddr
)
==
TRUE
)
{
if
(
IsValid
FP
(
regFP
,
stackStart
,
stackEnd
,
&
kvaddr
)
==
TRUE
)
{
found
=
TRUE
;
found
=
TRUE
;
goto
FOUND
;
goto
FOUND
;
}
}
...
@@ -685,23 +681,23 @@ VOID BackTraceSub(UINTPTR regFP)
...
@@ -685,23 +681,23 @@ VOID BackTraceSub(UINTPTR regFP)
* will still be stored and updated. In that case we needs to find the right position of frame pointer.
* will still be stored and updated. In that case we needs to find the right position of frame pointer.
*/
*/
tmpFP
=
*
(
UINTPTR
*
)(
UINTPTR
)
kvaddr
;
tmpFP
=
*
(
UINTPTR
*
)(
UINTPTR
)
kvaddr
;
if
(
IsValid
Vaddr
(
tmpFP
,
stackStart
,
stackEnd
,
NULL
)
==
TRUE
)
{
if
(
IsValid
FP
(
tmpFP
,
stackStart
,
stackEnd
,
NULL
)
==
TRUE
)
{
backFP
=
tmpFP
;
backFP
=
tmpFP
;
PrintExcInfo
(
"traceback fp fixed, trace using fp = 0x%x
\n
"
,
backFP
);
PrintExcInfo
(
"traceback fp fixed, trace using fp = 0x%x
\n
"
,
backFP
);
}
}
while
(
IsValid
Vaddr
(
backFP
,
stackStart
,
stackEnd
,
&
kvaddr
)
==
TRUE
)
{
while
(
IsValid
FP
(
backFP
,
stackStart
,
stackEnd
,
&
kvaddr
)
==
TRUE
)
{
tmpFP
=
backFP
;
tmpFP
=
backFP
;
#ifdef LOSCFG_COMPILER_CLANG_LLVM
#ifdef LOSCFG_COMPILER_CLANG_LLVM
backFP
=
*
(
UINTPTR
*
)(
UINTPTR
)
kvaddr
;
backFP
=
*
(
UINTPTR
*
)(
UINTPTR
)
kvaddr
;
if
(
IsValid
Vaddr
(
tmpFP
+
POINTER_SIZE
,
stackStart
,
stackEnd
,
&
kvaddr
)
==
FALSE
)
{
if
(
IsValid
FP
(
tmpFP
+
POINTER_SIZE
,
stackStart
,
stackEnd
,
&
kvaddr
)
==
FALSE
)
{
PrintExcInfo
(
"traceback backLR check failed, backLP: 0x%x
\n
"
,
tmpFP
+
POINTER_SIZE
);
PrintExcInfo
(
"traceback backLR check failed, backLP: 0x%x
\n
"
,
tmpFP
+
POINTER_SIZE
);
return
;
return
;
}
}
backLR
=
*
(
UINTPTR
*
)(
UINTPTR
)
kvaddr
;
backLR
=
*
(
UINTPTR
*
)(
UINTPTR
)
kvaddr
;
#else
#else
backLR
=
*
(
UINTPTR
*
)(
UINTPTR
)
kvaddr
;
backLR
=
*
(
UINTPTR
*
)(
UINTPTR
)
kvaddr
;
if
(
IsValid
Vaddr
(
tmpFP
-
POINTER_SIZE
,
stackStart
,
stackEnd
,
&
kvaddr
)
==
FALSE
)
{
if
(
IsValid
FP
(
tmpFP
-
POINTER_SIZE
,
stackStart
,
stackEnd
,
&
kvaddr
)
==
FALSE
)
{
PrintExcInfo
(
"traceback backFP check failed, backFP: 0x%x
\n
"
,
tmpFP
-
POINTER_SIZE
);
PrintExcInfo
(
"traceback backFP check failed, backFP: 0x%x
\n
"
,
tmpFP
-
POINTER_SIZE
);
return
;
return
;
}
}
...
...
fs/jffs2/src/vfs_jffs2.c
浏览文件 @
ca41a70d
...
@@ -202,6 +202,9 @@ int VfsJffs2Lookup(struct Vnode *parentVnode, const char *path, int len, struct
...
@@ -202,6 +202,9 @@ int VfsJffs2Lookup(struct Vnode *parentVnode, const char *path, int len, struct
(
void
)
VfsHashGet
(
parentVnode
->
originMount
,
node
->
i_ino
,
&
newVnode
,
NULL
,
NULL
);
(
void
)
VfsHashGet
(
parentVnode
->
originMount
,
node
->
i_ino
,
&
newVnode
,
NULL
,
NULL
);
LOS_MuxUnlock
(
&
g_jffs2FsLock
);
LOS_MuxUnlock
(
&
g_jffs2FsLock
);
if
(
newVnode
)
{
if
(
newVnode
)
{
if
(
newVnode
->
data
==
NULL
)
{
LOS_Panic
(
"#####VfsHashGet error#####
\n
"
);
}
*
ppVnode
=
newVnode
;
*
ppVnode
=
newVnode
;
return
0
;
return
0
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录