You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bool TypeInitializerPass::doInitialization(Module *M) {
// Initializing TypeValueMap
// Map every gloable struct wihout type name to their
// value name
for(Module::global_iterator gi = M->global_begin(),
ge = M->global_end(); gi != ge; ++gi) {
GlobalValue *GV = &*gi;
Type *GVTy = GV->getValueType();
string Vname = static_cast<string>(GV->getName());
if (StructType *GVSTy = dyn_cast<StructType>(GVTy)) {
if(GVSTy->hasName())
continue;
TypeValueMap.insert(pair<Type*, string>(GVTy,Vname));
}
}
// Initializing StructTNMap
// Map global variable name to their struct type name
for (Module::iterator ff = M->begin(),
MEnd = M->end();ff != MEnd; ++ff) {
Function *Func = &*ff;
if (Func->isIntrinsic())
continue;
for (inst_iterator ii = inst_begin(Func), e = inst_end(Func);
ii != e; ++ii) {
Instruction *Inst = &*ii;
unsigned T = Inst->getNumOperands();
for(int i = 0; i < T; i++) {
Value *VI = Inst->getOperand(i);
if (!VI)
continue;
if (!VI->hasName())
continue;
Type *VT = VI->getType();
while(VT && VT->isPointerTy())
VT = VT->getPointerElementType();
if (!VT)
continue;
if (StructType *SVT = dyn_cast<StructType>(VT)) {
if (SVT->isLiteral()){
continue;
}
string ValueName = static_cast<string>(VI->getName());
string StructName = static_cast<string>(SVT->getName());
VnameToTypenameMap.insert(pair<string, string>(ValueName,StructName));
}
}
}
}
return false;
}
作者您好!
在尝试复现时,
prepare_for_manual_instrument
和prepare_kernel_bitcode
两个阶段可以正常运行,不过在analyze_kernel_syscall
时出现了问题。具体来说,在
source/syzdirect/Runner/SyscallAnalyze/SyscallAnalyze.py
文件中的第24
行,运行代码generating_cmd=f"cd {caseInterfaceWorkingDir} && {Config.FunctionModelBinary} --verbose-level=4 {caseBitcodeDir} 2>&1 | tee log"
时(命令展开为cd /home/xxx/SyzDirect/source/syzdirect/Runner/workdir/interfaces/case_0 && /home/xxx/SyzDirect/source/syzdirect/syzdirect_function_model/build/lib/interface_generator --verbose-level=4 /home/xxx/SyzDirect/source/syzdirect/Runner/workdir/bcs/case_0 2>&1 | tee log
),调用了interface_generator
,不过在interface_generator
运行时出现了assert failed,backtrace可以发现:可以发现是getName函数触发的断言错误,以代码中的
source/syzdirect/syzdirect_function_model/src/lib/TypeInitializer.cc
文件中的bool TypeInitializerPass::doInitialization(Module *M)
函数为例。其在执行到
语句时,会触发llvm中的 /home/zec/SyzDirect/source/llvm-project-new/llvm/lib/IR/Type.cpp 这个文件中的一个assert failed
并不是每次调用都会产生断言错误,不过在其他文件中调用
getName()
时也有概率产生。我不太清楚这是否意味着内核bitcode的生成出现了问题,还是什么其他的问题,希望作者能给与一些指导。
感谢您的帮助!
另,使用的BUG内核commit为数据集中的commit
11c514a99bb960941535134f0587102855e8ddee
,机器配置为32C+64GThe text was updated successfully, but these errors were encountered: