Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
65790b67
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
1 年多 前同步成功
通知
460
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看板
未验证
提交
65790b67
编写于
7月 25, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
!937 拼写错误修正
Merge pull request !937 from yinjiaming/dev
上级
9eff5cff
99ea8d4e
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
43 addition
and
43 deletion
+43
-43
kernel/base/include/los_sem_debug_pri.h
kernel/base/include/los_sem_debug_pri.h
+3
-3
kernel/base/ipc/los_queue_debug.c
kernel/base/ipc/los_queue_debug.c
+5
-5
kernel/base/ipc/los_sem_debug.c
kernel/base/ipc/los_sem_debug.c
+8
-8
kernel/base/mem/tlsf/los_memory.c
kernel/base/mem/tlsf/los_memory.c
+1
-1
kernel/extended/lms/los_lms.c
kernel/extended/lms/los_lms.c
+9
-9
kernel/extended/lms/los_lms_pri.h
kernel/extended/lms/los_lms_pri.h
+2
-2
kernel/extended/lms/usr/los_lms.c
kernel/extended/lms/usr/los_lms.c
+11
-11
kernel/extended/lms/usr/los_lms_pri.h
kernel/extended/lms/usr/los_lms_pri.h
+2
-2
kernel/extended/lms/usr/los_lmslibc.c
kernel/extended/lms/usr/los_lmslibc.c
+1
-1
syscall/syscall_lookup.h
syscall/syscall_lookup.h
+1
-1
未找到文件。
kernel/base/include/los_sem_debug_pri.h
浏览文件 @
65790b67
...
...
@@ -61,11 +61,11 @@ STATIC INLINE VOID OsSemDbgTimeUpdateHook(UINT32 semID)
return
;
}
/* Update the SEM_DEBUG_CB of the semaphore when created or deleted */
extern
VOID
OsSemDbgUpdate
(
UINT32
semID
,
TSK_ENTRY_FUNC
creat
e
r
,
UINT16
count
);
STATIC
INLINE
VOID
OsSemDbgUpdateHook
(
UINT32
semID
,
TSK_ENTRY_FUNC
creat
e
r
,
UINT16
count
)
extern
VOID
OsSemDbgUpdate
(
UINT32
semID
,
TSK_ENTRY_FUNC
creat
o
r
,
UINT16
count
);
STATIC
INLINE
VOID
OsSemDbgUpdateHook
(
UINT32
semID
,
TSK_ENTRY_FUNC
creat
o
r
,
UINT16
count
)
{
#ifdef LOSCFG_DEBUG_SEMAPHORE
OsSemDbgUpdate
(
semID
,
creat
e
r
,
count
);
OsSemDbgUpdate
(
semID
,
creat
o
r
,
count
);
#endif
return
;
}
...
...
kernel/base/ipc/los_queue_debug.c
浏览文件 @
65790b67
...
...
@@ -40,7 +40,7 @@
#ifdef LOSCFG_DEBUG_QUEUE
typedef
struct
{
TSK_ENTRY_FUNC
creat
e
r
;
/* The task entry who created this queue */
TSK_ENTRY_FUNC
creat
o
r
;
/* The task entry who created this queue */
UINT64
lastAccessTime
;
/* The last access time */
}
QueueDebugCB
;
STATIC
QueueDebugCB
*
g_queueDebugArray
=
NULL
;
...
...
@@ -74,7 +74,7 @@ VOID OsQueueDbgTimeUpdate(UINT32 queueID)
VOID
OsQueueDbgUpdate
(
UINT32
queueID
,
TSK_ENTRY_FUNC
entry
)
{
QueueDebugCB
*
queueDebug
=
&
g_queueDebugArray
[
GET_QUEUE_INDEX
(
queueID
)];
queueDebug
->
creat
e
r
=
entry
;
queueDebug
->
creat
o
r
=
entry
;
queueDebug
->
lastAccessTime
=
LOS_TickCountGet
();
return
;
}
...
...
@@ -91,8 +91,8 @@ STATIC INLINE VOID OsQueueInfoOutPut(const LosQueueCB *node)
STATIC
INLINE
VOID
OsQueueOpsOutput
(
const
QueueDebugCB
*
node
)
{
PRINTK
(
"TaskEntry of creat
e
r:0x%p, Latest operation time: 0x%llx
\n
"
,
node
->
creat
e
r
,
node
->
lastAccessTime
);
PRINTK
(
"TaskEntry of creat
o
r:0x%p, Latest operation time: 0x%llx
\n
"
,
node
->
creat
o
r
,
node
->
lastAccessTime
);
}
STATIC
VOID
SortQueueIndexArray
(
UINT32
*
indexArray
,
UINT32
count
)
...
...
@@ -149,7 +149,7 @@ VOID OsQueueCheck(VOID)
&
g_queueDebugArray
[
index
],
sizeof
(
QueueDebugCB
));
SCHEDULER_UNLOCK
(
intSave
);
if
((
queueNode
.
queueState
==
OS_QUEUE_UNUSED
)
||
((
queueNode
.
queueState
==
OS_QUEUE_INUSED
)
&&
(
queueDebugNode
.
creat
e
r
==
NULL
)))
{
((
queueNode
.
queueState
==
OS_QUEUE_INUSED
)
&&
(
queueDebugNode
.
creat
o
r
==
NULL
)))
{
continue
;
}
if
((
queueNode
.
queueState
==
OS_QUEUE_INUSED
)
&&
...
...
kernel/base/ipc/los_sem_debug.c
浏览文件 @
65790b67
...
...
@@ -80,7 +80,7 @@ STATIC VOID OsSemPendedTaskNamePrint(LosSemCB *semNode)
typedef
struct
{
UINT16
origSemCount
;
/* Number of original available semaphores */
UINT64
lastAccessTime
;
/* The last operation time */
TSK_ENTRY_FUNC
creat
e
r
;
/* The task entry who created this sem */
TSK_ENTRY_FUNC
creat
o
r
;
/* The task entry who created this sem */
}
SemDebugCB
;
STATIC
SemDebugCB
*
g_semDebugArray
=
NULL
;
...
...
@@ -110,10 +110,10 @@ VOID OsSemDbgTimeUpdate(UINT32 semID)
return
;
}
VOID
OsSemDbgUpdate
(
UINT32
semID
,
TSK_ENTRY_FUNC
creat
e
r
,
UINT16
count
)
VOID
OsSemDbgUpdate
(
UINT32
semID
,
TSK_ENTRY_FUNC
creat
o
r
,
UINT16
count
)
{
SemDebugCB
*
semDebug
=
&
g_semDebugArray
[
GET_SEM_INDEX
(
semID
)];
semDebug
->
creat
er
=
create
r
;
semDebug
->
creat
or
=
creato
r
;
semDebug
->
lastAccessTime
=
LOS_TickCountGet
();
semDebug
->
origSemCount
=
count
;
return
;
...
...
@@ -133,7 +133,7 @@ STATIC VOID OsSemSort(UINT32 *semIndexArray, UINT32 usedCount)
/* It will Print out ALL the Used Semaphore List. */
PRINTK
(
"Used Semaphore List:
\n
"
);
PRINTK
(
"
\r\n
SemID Count OriginalCount Creat
e
r(TaskEntry) LastAccessTime
\n
"
);
PRINTK
(
"
\r\n
SemID Count OriginalCount Creat
o
r(TaskEntry) LastAccessTime
\n
"
);
PRINTK
(
" ------ ------ ------------- ------------------ --------------
\n
"
);
SCHEDULER_LOCK
(
intSave
);
...
...
@@ -145,11 +145,11 @@ STATIC VOID OsSemSort(UINT32 *semIndexArray, UINT32 usedCount)
(
VOID
)
memcpy_s
(
&
semNode
,
sizeof
(
LosSemCB
),
semCB
,
sizeof
(
LosSemCB
));
(
VOID
)
memcpy_s
(
&
semDebug
,
sizeof
(
SemDebugCB
),
&
g_semDebugArray
[
semIndexArray
[
i
]],
sizeof
(
SemDebugCB
));
SCHEDULER_UNLOCK
(
intSave
);
if
((
semNode
.
semStat
!=
OS_SEM_USED
)
||
(
semDebug
.
creat
e
r
==
NULL
))
{
if
((
semNode
.
semStat
!=
OS_SEM_USED
)
||
(
semDebug
.
creat
o
r
==
NULL
))
{
continue
;
}
PRINTK
(
" 0x%-07x0x%-07u0x%-14u%-22p0x%llx
\n
"
,
semNode
.
semID
,
semDebug
.
origSemCount
,
semNode
.
semCount
,
semDebug
.
creat
e
r
,
semDebug
.
lastAccessTime
);
semNode
.
semCount
,
semDebug
.
creat
o
r
,
semDebug
.
lastAccessTime
);
if
(
!
LOS_ListEmpty
(
&
semNode
.
semList
))
{
OsSemPendedTaskNamePrint
(
semCB
);
}
...
...
@@ -170,7 +170,7 @@ UINT32 OsSemInfoGetFullData(VOID)
for
(
i
=
0
;
i
<
LOSCFG_BASE_IPC_SEM_LIMIT
;
i
++
)
{
semNode
=
GET_SEM
(
i
);
semDebug
=
&
g_semDebugArray
[
i
];
if
((
semNode
->
semStat
==
OS_SEM_USED
)
&&
(
semDebug
->
creat
e
r
!=
NULL
))
{
if
((
semNode
->
semStat
==
OS_SEM_USED
)
&&
(
semDebug
->
creat
o
r
!=
NULL
))
{
usedSemCnt
++
;
}
}
...
...
@@ -190,7 +190,7 @@ UINT32 OsSemInfoGetFullData(VOID)
for
(
i
=
0
;
i
<
LOSCFG_BASE_IPC_SEM_LIMIT
;
i
++
)
{
semNode
=
GET_SEM
(
i
);
semDebug
=
&
g_semDebugArray
[
i
];
if
((
semNode
->
semStat
!=
OS_SEM_USED
)
||
(
semDebug
->
creat
e
r
==
NULL
))
{
if
((
semNode
->
semStat
!=
OS_SEM_USED
)
||
(
semDebug
->
creat
o
r
==
NULL
))
{
continue
;
}
*
(
semIndexArray
+
count
)
=
i
;
...
...
kernel/base/mem/tlsf/los_memory.c
浏览文件 @
65790b67
...
...
@@ -498,7 +498,7 @@ STATIC INLINE VOID OsLmsReallocMergeNodeMark(struct OsMemNodeHead *node)
}
g_lms
->
simpleMark
((
UINTPTR
)
node
+
OS_MEM_NODE_HEAD_SIZE
,
(
UINTPTR
)
OS_MEM_NEXT_NODE
(
node
),
LMS_SHADOW_ACCESS
A
BLE_U8
);
LMS_SHADOW_ACCESS
I
BLE_U8
);
}
STATIC
INLINE
VOID
OsLmsReallocSplitNodeMark
(
struct
OsMemNodeHead
*
node
)
...
...
kernel/extended/lms/los_lms.c
浏览文件 @
65790b67
...
...
@@ -326,7 +326,7 @@ VOID OsLmsLosMallocMark(const VOID *curNodeStart, const VOID *nextNodeStart, UIN
}
OsLmsSetShadowValue
(
node
,
curNodeStartAddr
,
curNodeStartAddr
+
nodeHeadSize
,
LMS_SHADOW_REDZONE_U8
);
OsLmsSetShadowValue
(
node
,
curNodeStartAddr
+
nodeHeadSize
,
nextNodeStartAddr
,
LMS_SHADOW_ACCESS
A
BLE_U8
);
OsLmsSetShadowValue
(
node
,
curNodeStartAddr
+
nodeHeadSize
,
nextNodeStartAddr
,
LMS_SHADOW_ACCESS
I
BLE_U8
);
OsLmsSetShadowValue
(
node
,
nextNodeStartAddr
,
nextNodeStartAddr
+
nodeHeadSize
,
LMS_SHADOW_REDZONE_U8
);
LMS_UNLOCK
(
intSave
);
}
...
...
@@ -344,7 +344,7 @@ VOID OsLmsCheckValid(UINTPTR checkAddr, BOOL isFreeCheck)
OsLmsGetShadowValue
(
node
,
checkAddr
,
&
shadowValue
);
LMS_UNLOCK
(
intSave
);
if
((
shadowValue
==
LMS_SHADOW_ACCESS
A
BLE
)
||
((
isFreeCheck
)
&&
(
shadowValue
==
LMS_SHADOW_PAINT
)))
{
if
((
shadowValue
==
LMS_SHADOW_ACCESS
I
BLE
)
||
((
isFreeCheck
)
&&
(
shadowValue
==
LMS_SHADOW_PAINT
)))
{
return
;
}
...
...
@@ -367,7 +367,7 @@ VOID OsLmsLosFreeMark(const VOID *curNodeStart, const VOID *nextNodeStart, UINT3
UINTPTR
nextNodeStartAddr
=
(
UINTPTR
)
nextNodeStart
;
OsLmsGetShadowValue
(
node
,
curNodeStartAddr
+
nodeHeadSize
,
&
shadowValue
);
if
((
shadowValue
!=
LMS_SHADOW_ACCESS
A
BLE
)
&&
(
shadowValue
!=
LMS_SHADOW_PAINT
))
{
if
((
shadowValue
!=
LMS_SHADOW_ACCESS
I
BLE
)
&&
(
shadowValue
!=
LMS_SHADOW_PAINT
))
{
LMS_UNLOCK
(
intSave
);
OsLmsReportError
(
curNodeStartAddr
+
nodeHeadSize
,
MEM_REGION_SIZE_1
,
FREE_ERRORMODE
);
return
;
...
...
@@ -408,7 +408,7 @@ VOID LOS_LmsAddrDisableProtect(UINTPTR addrStart, UINTPTR addrEnd)
LMS_LOCK
(
intSave
);
LmsMemListNode
*
node
=
OsLmsGetPoolNodeFromAddr
(
addrStart
);
if
(
node
!=
NULL
)
{
OsLmsSetShadowValue
(
node
,
addrStart
,
addrEnd
,
LMS_SHADOW_ACCESS
A
BLE_U8
);
OsLmsSetShadowValue
(
node
,
addrStart
,
addrEnd
,
LMS_SHADOW_ACCESS
I
BLE_U8
);
}
LMS_UNLOCK
(
intSave
);
}
...
...
@@ -426,7 +426,7 @@ STATIC UINT32 OsLmsCheckAddr(UINTPTR addr)
LmsMemListNode
*
node
=
OsLmsGetPoolNodeFromAddr
(
addr
);
if
(
node
==
NULL
)
{
LMS_UNLOCK
(
intSave
);
return
LMS_SHADOW_ACCESS
A
BLE_U8
;
return
LMS_SHADOW_ACCESS
I
BLE_U8
;
}
OsLmsGetShadowValue
(
node
,
addr
,
&
shadowValue
);
...
...
@@ -542,7 +542,7 @@ STATIC VOID OsLmsGetErrorInfo(UINTPTR addr, UINT32 size, LmsAddrInfo *info)
{
LmsMemListNode
*
node
=
OsLmsGetPoolNodeFromAddr
(
addr
);
OsLmsGetShadowInfo
(
node
,
addr
,
info
);
if
(
info
->
shadowValue
!=
LMS_SHADOW_ACCESS
A
BLE_U8
)
{
if
(
info
->
shadowValue
!=
LMS_SHADOW_ACCESS
I
BLE_U8
)
{
return
;
}
else
{
OsLmsGetShadowInfo
(
node
,
addr
+
size
-
1
,
info
);
...
...
@@ -558,7 +558,7 @@ STATIC VOID OsLmsPrintErrInfo(LmsAddrInfo *info, UINT32 errMod)
case
LMS_SHADOW_REDZONE
:
PRINT_ERR
(
"Heap buffer overflow error detected
\n
"
);
break
;
case
LMS_SHADOW_ACCESS
A
BLE
:
case
LMS_SHADOW_ACCESS
I
BLE
:
PRINT_ERR
(
"No error
\n
"
);
break
;
default:
...
...
@@ -614,7 +614,7 @@ VOID OsLmsReportError(UINTPTR p, UINT32 size, UINT32 errMod)
#ifdef LOSCFG_LMS_STORE_CHECK
VOID
__asan_store1_noabort
(
UINTPTR
p
)
{
if
(
OsLmsCheckAddr
(
p
)
!=
LMS_SHADOW_ACCESS
A
BLE_U8
)
{
if
(
OsLmsCheckAddr
(
p
)
!=
LMS_SHADOW_ACCESS
I
BLE_U8
)
{
OsLmsReportError
(
p
,
MEM_REGION_SIZE_1
,
STORE_ERRMODE
);
}
}
...
...
@@ -690,7 +690,7 @@ VOID __asan_storeN_noabort(UINTPTR p, UINT32 size)
#ifdef LOSCFG_LMS_LOAD_CHECK
VOID
__asan_load1_noabort
(
UINTPTR
p
)
{
if
(
OsLmsCheckAddr
(
p
)
!=
LMS_SHADOW_ACCESS
A
BLE_U8
)
{
if
(
OsLmsCheckAddr
(
p
)
!=
LMS_SHADOW_ACCESS
I
BLE_U8
)
{
OsLmsReportError
(
p
,
MEM_REGION_SIZE_1
,
LOAD_ERRMODE
);
}
}
...
...
kernel/extended/lms/los_lms_pri.h
浏览文件 @
65790b67
...
...
@@ -59,13 +59,13 @@ extern "C" {
#define LMS_POOL_RESIZE(size) ((size) / (LMS_SHADOW_U8_REFER_BYTES + 1) * LMS_SHADOW_U8_REFER_BYTES)
#define LMS_ADDR_ALIGN(p) (((UINTPTR)(p) + sizeof(UINTPTR) - 1) & ~((UINTPTR)(sizeof(UINTPTR) - 1)))
#define LMS_SHADOW_ACCESS
A
BLE 0x00
#define LMS_SHADOW_ACCESS
I
BLE 0x00
#define LMS_SHADOW_AFTERFREE 0x03
#define LMS_SHADOW_REDZONE 0x02
#define LMS_SHADOW_PAINT 0x01
#define LMS_SHADOW_MASK 0x03
#define LMS_SHADOW_ACCESS
A
BLE_U8 0x00
#define LMS_SHADOW_ACCESS
I
BLE_U8 0x00
#define LMS_SHADOW_AFTERFREE_U8 0xFF
#define LMS_SHADOW_REDZONE_U8 0xAA
#define LMS_SHADOW_MASK_U8 0xFF
...
...
kernel/extended/lms/usr/los_lms.c
浏览文件 @
65790b67
...
...
@@ -174,7 +174,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsGetShadowValue(uintptr_t addr, uint32_t *s
LmsMem2Shadow
(
addr
,
&
shadowAddr
,
&
shadowOffset
);
/* If the shadow addr is not mapped then regarded as legal access */
if
(
LmsIsShadowAddrMapped
(
shadowAddr
,
shadowAddr
)
!=
LMS_OK
)
{
*
shadowValue
=
LMS_SHADOW_ACCESS
A
BLE_U8
;
*
shadowValue
=
LMS_SHADOW_ACCESS
I
BLE_U8
;
return
;
}
...
...
@@ -185,7 +185,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsMallocMark(uintptr_t preRzStart, uintptr_t
uintptr_t
RzEndAddr
)
{
LmsSetShadowValue
(
preRzStart
,
accessMemStart
,
LMS_SHADOW_REDZONE_U8
);
LmsSetShadowValue
(
accessMemStart
,
nextRzStart
,
LMS_SHADOW_ACCESS
A
BLE_U8
);
LmsSetShadowValue
(
accessMemStart
,
nextRzStart
,
LMS_SHADOW_ACCESS
I
BLE_U8
);
LmsSetShadowValue
(
nextRzStart
,
RzEndAddr
,
LMS_SHADOW_REDZONE_U8
);
}
...
...
@@ -300,7 +300,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS static inline void LmsGetShadowInfo(uintptr_t memA
ATTRIBUTE_NO_SANITIZE_ADDRESS
static
void
LmsGetErrorInfo
(
uintptr_t
addr
,
size_t
size
,
LmsAddrInfo
*
info
)
{
LmsGetShadowInfo
(
addr
,
info
);
if
(
info
->
shadowValue
!=
LMS_SHADOW_ACCESS
A
BLE_U8
)
{
if
(
info
->
shadowValue
!=
LMS_SHADOW_ACCESS
I
BLE_U8
)
{
return
;
}
else
{
LmsGetShadowInfo
(
addr
+
size
-
1
,
info
);
...
...
@@ -316,7 +316,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS static void LmsPrintErrInfo(LmsAddrInfo *info, uin
case
LMS_SHADOW_REDZONE
:
LMS_OUTPUT_ERROR
(
"Heap buffer overflow error detected!
\n
"
);
break
;
case
LMS_SHADOW_ACCESS
A
BLE
:
case
LMS_SHADOW_ACCESS
I
BLE
:
LMS_OUTPUT_ERROR
(
"No error!
\n
"
);
break
;
default:
...
...
@@ -343,7 +343,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS static void LmsPrintErrInfo(LmsAddrInfo *info, uin
info
->
shadowOffset
,
info
->
shadowValue
);
LMS_OUTPUT_INFO
(
"
\n
"
);
LMS_OUTPUT_INFO
(
"%-25s%d
\n
"
,
"Access
able heap addr"
,
LMS_SHADOW_ACCESSA
BLE
);
LMS_OUTPUT_INFO
(
"%-25s%d
\n
"
,
"Access
ible heap addr"
,
LMS_SHADOW_ACCESSI
BLE
);
LMS_OUTPUT_INFO
(
"%-25s%d
\n
"
,
"Heap red zone"
,
LMS_SHADOW_REDZONE
);
LMS_OUTPUT_INFO
(
"%-25s%d
\n
"
,
"Heap freed buffer"
,
LMS_SHADOW_AFTERFREE
);
LMS_OUTPUT_INFO
(
"
\n
"
);
...
...
@@ -373,23 +373,23 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsReportError(uintptr_t p, size_t size, uint
void
LmsCheckValid
(
const
char
*
dest
,
const
char
*
src
)
{
if
(
LmsCheckAddr
((
uintptr_t
)
dest
)
!=
LMS_SHADOW_ACCESS
A
BLE_U8
)
{
if
(
LmsCheckAddr
((
uintptr_t
)
dest
)
!=
LMS_SHADOW_ACCESS
I
BLE_U8
)
{
LmsReportError
((
uintptr_t
)
dest
,
MEM_REGION_SIZE_1
,
STORE_ERRMODE
);
return
;
}
if
(
LmsCheckAddr
((
uintptr_t
)
src
)
!=
LMS_SHADOW_ACCESS
A
BLE_U8
)
{
if
(
LmsCheckAddr
((
uintptr_t
)
src
)
!=
LMS_SHADOW_ACCESS
I
BLE_U8
)
{
LmsReportError
((
uintptr_t
)
src
,
MEM_REGION_SIZE_1
,
LOAD_ERRMODE
);
return
;
}
for
(
uint32_t
i
=
0
;
*
(
src
+
i
)
!=
'\0'
;
i
++
)
{
if
(
LmsCheckAddr
((
uintptr_t
)
dest
+
i
+
1
)
!=
LMS_SHADOW_ACCESS
A
BLE_U8
)
{
if
(
LmsCheckAddr
((
uintptr_t
)
dest
+
i
+
1
)
!=
LMS_SHADOW_ACCESS
I
BLE_U8
)
{
LmsReportError
((
uintptr_t
)
dest
+
i
+
1
,
MEM_REGION_SIZE_1
,
STORE_ERRMODE
);
return
;
}
if
(
LmsCheckAddr
((
uintptr_t
)
src
+
i
+
1
)
!=
LMS_SHADOW_ACCESS
A
BLE_U8
)
{
if
(
LmsCheckAddr
((
uintptr_t
)
src
+
i
+
1
)
!=
LMS_SHADOW_ACCESS
I
BLE_U8
)
{
LmsReportError
((
uintptr_t
)
src
+
i
+
1
,
MEM_REGION_SIZE_1
,
LOAD_ERRMODE
);
return
;
}
...
...
@@ -398,7 +398,7 @@ void LmsCheckValid(const char *dest, const char *src)
void
__asan_store1_noabort
(
uintptr_t
p
)
{
if
(
LmsCheckAddr
(
p
)
!=
LMS_SHADOW_ACCESS
A
BLE_U8
)
{
if
(
LmsCheckAddr
(
p
)
!=
LMS_SHADOW_ACCESS
I
BLE_U8
)
{
LmsReportError
(
p
,
MEM_REGION_SIZE_1
,
STORE_ERRMODE
);
}
}
...
...
@@ -440,7 +440,7 @@ void __asan_storeN_noabort(uintptr_t p, size_t size)
void
__asan_load1_noabort
(
uintptr_t
p
)
{
if
(
LmsCheckAddr
(
p
)
!=
LMS_SHADOW_ACCESS
A
BLE_U8
)
{
if
(
LmsCheckAddr
(
p
)
!=
LMS_SHADOW_ACCESS
I
BLE_U8
)
{
LmsReportError
(
p
,
MEM_REGION_SIZE_1
,
LOAD_ERRMODE
);
}
}
...
...
kernel/extended/lms/usr/los_lms_pri.h
浏览文件 @
65790b67
...
...
@@ -50,7 +50,7 @@ extern "C" {
#define SANITIZER_INTERFACE_ATTRIBUTE
#define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
#define LMS_SHADOW_ACCESS
A
BLE 0x00
#define LMS_SHADOW_ACCESS
I
BLE 0x00
#define LMS_SHADOW_AFTERFREE 0x03
#define LMS_SHADOW_REDZONE 0x02
#define LMS_SHADOW_PAINT 0x01
...
...
@@ -61,7 +61,7 @@ extern "C" {
#define LMS_SHADOW_U8_CELL_NUM 4
#define LMS_SHADOW_U8_REFER_BYTES 16
#define LMS_SHADOW_ACCESS
A
BLE_U8 0x00
#define LMS_SHADOW_ACCESS
I
BLE_U8 0x00
#define LMS_SHADOW_AFTERFREE_U8 0xFF
#define LMS_SHADOW_REDZONE_U8 0xAA
#define LMS_SHADOW_MASK_U8 0xFF
...
...
kernel/extended/lms/usr/los_lmslibc.c
浏览文件 @
65790b67
...
...
@@ -45,7 +45,7 @@ ATTRIBUTE_NO_SANITIZE_ADDRESS void LmsFree(void *ptr)
if
(
LmsIsShadowAddrMapped
(
shadowAddr
,
shadowAddr
)
==
LMS_OK
)
{
uint32_t
acShadowValue
;
LmsGetShadowValue
((
uintptr_t
)
ptr
,
&
acShadowValue
);
if
(
acShadowValue
!=
LMS_SHADOW_ACCESS
A
BLE
)
{
if
(
acShadowValue
!=
LMS_SHADOW_ACCESS
I
BLE
)
{
char
erroMode
=
(
acShadowValue
==
LMS_SHADOW_AFTERFREE
?
FREE_ERRORMODE
:
UNKNOWN_ERROR
);
LmsReportError
((
uintptr_t
)
ptr
,
MEM_REGION_SIZE_1
,
erroMode
);
goto
UNLOCK_OUT
;
...
...
syscall/syscall_lookup.h
浏览文件 @
65790b67
...
...
@@ -263,7 +263,7 @@ SYSCALL_HAND_DEF(__NR_statx, SysStatx, int, ARG_NUM_5)
SYSCALL_HAND_DEF
(
__NR_pthread_set_detach
,
SysUserThreadSetDetach
,
int
,
ARG_NUM_1
)
SYSCALL_HAND_DEF
(
__NR_pthread_join
,
SysThreadJoin
,
int
,
ARG_NUM_1
)
SYSCALL_HAND_DEF
(
__NR_pthread_deatch
,
SysUserThreadDetach
,
int
,
ARG_NUM_1
)
SYSCALL_HAND_DEF
(
__NR_creat_user_thread
,
SysCreateUserThread
,
unsigned
int
,
ARG_NUM_3
)
SYSCALL_HAND_DEF
(
__NR_creat
e
_user_thread
,
SysCreateUserThread
,
unsigned
int
,
ARG_NUM_3
)
SYSCALL_HAND_DEF
(
__NR_getrusage
,
SysGetrusage
,
int
,
ARG_NUM_2
)
SYSCALL_HAND_DEF
(
__NR_sysconf
,
SysSysconf
,
long
,
ARG_NUM_1
)
SYSCALL_HAND_DEF
(
__NR_ugetrlimit
,
SysUgetrlimit
,
int
,
ARG_NUM_2
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录