提交 92a4fa8e 编写于 作者: X xiacong

fix: 修复解析arm的libc库时某个分支异常的问题

修复audit解析arm相关的audit日志时无输出的情况
Signed-off-by: Nxiacong <xiacong4@huawei.com>
Change-Id: I9e382799230f02bd9c5a7c8dd68de56e0a88bff5
Signed-off-by: Nxiacong <xiacong4@huawei.com>
上级 eb438eb7
......@@ -59,7 +59,7 @@ def get_item_content(name_nr_table, arch_nr_table):
syscall_name_dict.get('arm').remove(func_name)
else:
content = '{}{};arm64\n'.format(content, func_name)
if not syscall_name_dict.get('arm'):
if syscall_name_dict.get('arm'):
content = '{}{};arm\n'.format(content, ';arm\n'.join(
[func_name for func_name in syscall_name_dict.get('arm')]))
......
......@@ -67,7 +67,7 @@ def get_lib_path(elf_path, elf_name, cmd_extra):
grep_unstrip = ' | grep unstripped | grep -v _x64 {}'.format(cmd_extra)
if elf_name == 'libc++.so':
grep_unstrip = ''
grep_unstrip = '| grep aarch64-linux'
cmd = 'find {} -name {}{}'.format(elf_path, elf_name, grep_unstrip)
result_list = os.popen(cmd).read().split('\n')
result = result_list[0].strip()
......@@ -281,9 +281,9 @@ def get_function_name_nr_table(src_syscall_path):
def collect_concrete_syscall(args):
if args.target_cpu == 'arm64':
arch_str = 'aarch64'
arch_str = 'aarch64-linux'
elif args.target_cpu == 'arm':
arch_str = 'arm'
arch_str = 'arm-linux'
libc_path = get_lib_path(args.src_elf_path, 'libc.so', ' | grep ' + arch_str)
libc_asm_path = generate_libc_asm(args.target_cpu, libc_path, '.')
......
......@@ -61,6 +61,8 @@ def remove_head_zero(addr):
def line_find_syscall_nr(line, nr_set, nr_last):
nr = nr_last
is_find_nr = False
is_find_svc = True
if ';' in line:
nr_tmp, is_digit = gen_policy.str_convert_to_int(line[line.find('0x'):])
else:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册