Linux报错audit: backlog limit exceeded

Linux报错audit: backlog limit exceeded


现象:Linux ssh连接不上,能ping通,登录界面报错提示 audit: backlog limit exceeded

原因:该错误为 Linux Kernel logs,问题的原因是audit服务在繁忙的系统中进行审计事件操作,缓冲区存在瓶颈,导致系统接近崩溃。

背景介绍:

audit是linux系统中用于记录用户底层调用情况的服务,用来记录用户执行的open,exit等系统调用行为,并会将记录写到日志文件中。
audit可以通过使用 auditctl 命令来添加或删除audit规则,可以设置针对某个用户进行记录,或针对某个进程的进行记录。

主要命令:
auditctl audit 规则&系统管理工具,用来获取状态,增加删除监控规则
ausearch       查询audit log工具
aureport       输出audit系统报告


解决办法:可以尝试增大 audit buffer 来解决该问题。

Linux 默认内存分页大小为 4096 Bytes,通过下面命令可以获取分页大小:getconf PAGE_SIZE,可以设置为分页的N倍数

查看帮助信息
auditctl -h

查看当前默认配置
auditctl -s

backlog_limit 320 #我Centos7.1默认只为320

优化audit服务修改buffer大小
auditctl -b 8192
如果不设置系统默认为64Bytes

设置永久生效:
方法1)修改规则配置
vim /etc/audit/audit.rules
-D
-b 8192
-f 1

参数说明:
-D          删除所有规则
-b          设置audit缓冲大小,若缓冲占满了,则kernel会发出一个失败标记
-f [0|1|2]  设置audit获取错误的等级。有0/1/2三个值。0是不输出日志;1为输出printk日志;2为最高级、会输出大量日志信息
-e [0|1]    启用/禁用audit审核


方法2)
也可以直接在自启动中设置
chmod u+x /etc/rc.d/rc.local
vim /etc/rc.d/rc.local
auditctl -b 8192

安卓APP访问CAN有如下报错05-16 18:09:54.015 8022 8022 D can_test: nCanFd = 67 05-16 18:09:54.015 8022 8022 D can_test: Send can_id 05-16 18:09:54.013 8022 8022 I com.bin.cantest: type=1400 audit(0.0:444): avc: denied { ioctl } for path="socket:[114169]" dev="sockfs" ino=114169 ioctlcmd=0x8933 scontext=u:r:system_app:s0 tcontext=u:r:system_app:s0 tclass=can_socket permissive=1 05-16 18:09:54.015 8022 8022 D can_test: Send Error frame[0] 05-16 18:09:54.013 8022 8022 I com.bin.cantest: type=1400 audit(0.0:445): avc: denied { bind } for scontext=u:r:system_app:s0 tcontext=u:r:system_app:s0 tclass=can_socket permissive=1 05-16 18:09:54.013 8022 8022 I com.bin.cantest: type=1400 audit(0.0:446): avc: denied { write } for path="socket:[114169]" dev="sockfs" ino=114169 scontext=u:r:system_app:s0 tcontext=u:r:system_app:s0 tclass=can_socket permissive=1 05-16 18:09:54.020 0 0 W audit : audit_lost=15 audit_rate_limit=5 audit_backlog_limit=64 05-16 18:09:54.020 0 0 E audit : rate limit exceeded 05-16 18:09:54.060 305 388 W APM::AudioPolicyEngine: getDevicesForStrategy() unknown strategy: -1 05-16 18:09:54.060 459 477 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4 05-16 18:09:54.150 459 1215 E TaskPersister: File error accessing recents directory (directory doesn't exist?). 05-16 18:09:56.930 274 401 D AudioHardwareTiny: do_out_standby,out = 0xea043b70,device = 0x2 05-16 18:09:56.932 274 401 D alsa_route: route_set_controls() set route 24 05-16 18:09:56.941 274 401 D AudioHardwareTiny: close device 05-16 18:09:56.943 459 477 I system_server: oneway function results will be dropped but finished with status OK and parcel size 4 05-16 18:10:00.010 620 620 D KeyguardClockSwitch: Updating clock:
06-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

sunny05296

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值