123 Star 0 Fork 27

src-openEuler / clamav

 / 详情

【20.03-LTS-SP1】【arm/x86】clamav包下的clambc命令执行报错

已验收
缺陷
创建于  
2021-04-28 15:18

【环境信息】
系统:arrch64,x86_64虚拟机
内存:4g
cpu:4核
OS版本:20.03-LTS-SP1
yum源:http://121.36.84.172/repo.openeuler.org/openEuler-20.03-LTS-SP1/update_20210421/
【问题复现步骤】
1.安装clamav包,yum install clamav
2.执行命令:clambc --version
3.执行命令:clambc h.txt -T 3, clambc h.txt -i, clambc h.txt -t
【预期结果】
命令执行成功
【实际结果】
执行报错,
LibClamAV Error: Missing file magic in bytecodeLibClamAV Error: Error at bytecode line 0
Unable to load bytecode: Malformed database
【附件信息】
输入图片说明

附件
zjl_long 2021-04-28 15:16

评论 (2)

zjl_long 创建了缺陷
zjl_long 负责人设置为small_leek
zjl_long 计划开始日期设置为2021-04-28
zjl_long 计划截止日期设置为2021-04-29
zjl_long 优先级设置为主要
zjl_long 关联仓库设置为src-openEuler/clamav
展开全部操作日志

问题分析:

  1. clambc --version
    报出来的LLVM is not compiled or not linked,因为构建过程中没有采用LLVM,所以属于正常情况,代码层面也没问题:
    clambc/bcrun.c
272     if (optget(opts, "version")->enabled) {
273         printf("Clam AntiVirus Bytecode Testing Tool %s\n", get_version());
274         cl_init(CL_INIT_DEFAULT);
275         cli_bytecode_printversion();
276         optfree(opts);
277         exit(0);
278     }
libclamav/bytecode_nojit.c-87-void cli_bytecode_printversion(void)
libclamav/bytecode_nojit.c-88-{
libclamav/bytecode_nojit.c:89:    printf("LLVM is not compiled or not linked\n");
libclamav/bytecode_nojit.c-90-}
  1. clambc file
    报出如下的问题,是因为文件格式不符合要求:
LibClamAV Error: Missing file magic in bytecodeLibClamAV Error: Error at bytecode line 0
Unable to load bytecode: Malformed database

如何验证?
clamav软件包下有文件bytecode-330.cvd,通过sigtool -u bytecode-330.cvd可以解压出一些*.cbc文件,执行clambc -i xx.cbc可以查看文件信息,例如:

[root@3ddb7080ed91 tmp]# clambc -i 3986187.cbc
Bytecode format functionality level: 7
Bytecode metadata:
	compiler version: clambc-0.98.1rc2
	compiled on: (1452691691) Wed Jan 13 21:28:11 2016
	compiled by: amishhammer
	target exclude: 0
	bytecode type: logical only
	bytecode functionality level: 52 - 0
	bytecode logical signature: BC.Legacy.Exploit.CVE_2010_1885-2;Engine:52-255,Target:3;0;6863703a2f2f{25-700}736372697074{1-3}6465666572
	virusname prefix: (null)
	virusnames: 0
	bytecode triggered on: files matching logical signature
	number of functions: 1
	number of types: 41
	number of global constants: 27
	number of debug nodes: 0
	bytecode APIs used:
	 read, seek, setvirusname, debug_print_str, debug_print_uint, file_find,
	 bytecode_rt_error, debug_print_str_start, debug_print_str_nonl,
	 file_find_limit, engine_functionality_level

采用以上方法,验证通过

zjl_long 任务状态待办的 修改为已验收

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
1
https://gitee.com/src-openeuler/clamav.git
git@gitee.com:src-openeuler/clamav.git
src-openeuler
clamav
clamav

搜索帮助