安全告警清理1115

Signed-off-by: ganchuantao <ganchuantao1@huawei.com>
Change-Id: I2e4f01fcb5c655391f49c0c553668416394ed054
This commit is contained in:
ganchuantao 2024-11-15 10:20:39 +08:00
parent bb431328e2
commit 3096293201
2 changed files with 5 additions and 0 deletions

View File

@ -120,6 +120,10 @@ std::string FtraceFsOps::GetKernelSymbols() const
CHECK_TRUE(restrictValue.size() > 0, "", "read kptr_restrict failed!");
bool valueChanged = false;
if (!COMMON::IsNumeric(restrictValue)) {
PROFILER_LOG_ERROR(LOG_CORE, "not numeric string");
return "";
}
if (std::stoi(restrictValue) == 0) {
SetKptrRestrict("1");
valueChanged = true;

View File

@ -383,6 +383,7 @@ static void WriteMmap(const char* data)
// 建立映射
char* pMap = CreateMmap();
if (data == nullptr || strlen(data) == 0) {
RemoveMmap(pMap);
return;
}
// 写入