feat: 支持Lms

1.【需求描述】:
   支持内核态堆内存非法访问检测,包括:越界访问、double free、释放后使用;支持libc常用高频函数内存检测;支持安全函数内存检测;读写检测可配可裁剪。
2.【方案描述】:
   (1).影子内存映射与标记
   (2).编译器使能-fsanitize=kernel-address 自动插桩检测点
   (3).实时校验影子内存的合法性;
   (4).错误访问打印回溯栈

BREAKING CHANGE: 新增支持API:

LOS_LmsCheckPoolAdd使能检测指定内存池
LOS_LmsCheckPoolDel不检测指定内存池
LOS_LmsAddrProtect为指定内存段上锁,不允许访问
LOS_LmsAddrDisableProtect去能指定内存段的访问保护

Close #I4HYBG

Signed-off-by: LiteOS2021 <dinglu@huawei.com>
Change-Id: Ia356a003088b9df37df667ea8ba91c80f5a41967
This commit is contained in:
LiteOS2021
2021-11-26 16:33:06 +08:00
parent 2cf3b19563
commit 7b838e8a7b
42 changed files with 3142 additions and 21 deletions

View File

@@ -162,6 +162,7 @@ typedef enum {
#endif
TEST_DRIVERBASE,
TEST_DYNLINK,
TEST_LMS,
} LiteOS_test_module;
typedef enum {

View File

@@ -85,6 +85,7 @@ extern "C" {
#define LOS_KERNEL_DYNLINK_TEST 0
#define LOS_KERNEL_TICKLESS_TEST 0
#define LOS_KERNEL_PM_TEST 1
#define LOS_KERNEL_LMS_TEST 0
#define LITEOS_CMSIS_TEST 0
#define LOS_CMSIS2_CORE_TASK_TEST 0