经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » 其他 » 网络安全 » 查看文章
银河麒麟SP2 auditd服务内存泄露问题
来源:cnblogs  作者:功夫小熊猫  时间:2023/8/29 8:51:18  对本文有异议

这几天遇到基于海光服务器的银河麒麟V10 SP2版本操作系统出现内存无故增长问题。

排查发现auditd服务,占用了大量内存。

我的环境是银河麒麟V10 SP2 524,audit版本audit-3.0-5.se.06

==5037== HEAP SUMMARY:
==5037==     in use at exit: 3,022 bytes in 210 blocks
==5037==   total heap usage: 415 allocs, 205 frees, 159,455 bytes allocated
==5037== 
==5037== 122 bytes in 35 blocks are definitely lost in loss record 1 of 6
==5037==    at 0x483479B: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==5037==    by 0x488435C: xmalloc (in /usr/lib64/libaudit.so.1.0.0)
==5037==    by 0x4884393: xmemdup (in /usr/lib64/libaudit.so.1.0.0)
==5037==    by 0x48848FF: ??? (in /usr/lib64/libaudit.so.1.0.0)
==5037==    by 0x4884B4C: get_file_sys_info (in /usr/lib64/libaudit.so.1.0.0)
==5037==    by 0x11217B: ??? (in /usr/sbin/auditd)
==5037==    by 0x112D83: ??? (in /usr/sbin/auditd)
==5037==    by 0x10ECA7: ??? (in /usr/sbin/auditd)
==5037==    by 0x4BD0B26: (below main) (libc-start.c:308)
==5037== 
==5037== 122 bytes in 35 blocks are definitely lost in loss record 2 of 6
==5037==    at 0x483479B: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==5037==    by 0x488435C: xmalloc (in /usr/lib64/libaudit.so.1.0.0)
==5037==    by 0x4884393: xmemdup (in /usr/lib64/libaudit.so.1.0.0)
==5037==    by 0x488494E: ??? (in /usr/lib64/libaudit.so.1.0.0)
==5037==    by 0x4884B4C: get_file_sys_info (in /usr/lib64/libaudit.so.1.0.0)
==5037==    by 0x11217B: ??? (in /usr/sbin/auditd)
==5037==    by 0x112D83: ??? (in /usr/sbin/auditd)
==5037==    by 0x10ECA7: ??? (in /usr/sbin/auditd)
==5037==    by 0x4BD0B26: (below main) (libc-start.c:308)

分析auditd服务存在内存泄露问题,位置在/usr/lib64/libaudit.so.1.0.0的get_file_sys_info处,malloc以后未释放。

auditd是审计服务,会对ssh的会话做日志记录,该问题出现在写日志前判断分区时的一部分代码。

经过循环ssh登录退出,也复现了这个现象。

 yum update audit

升级到audit-3.0-5.se.07.ky10及以后版本即可解决

我也找到了官方发布的补丁:https://www.kylinos.cn/index.php/support/update/6.html

 

原文链接:https://www.cnblogs.com/vpandaxjl/p/17663818.html

 友情链接:直通硅谷  直通硅谷 怎么样 mac软件下载