rsyslog 100% cpu

Discuss usability issues, general maintenance, and general support issues for a grsecurity-enabled system.

rsyslog 100% cpu

Postby lesnoland » Fri Nov 20, 2009 5:44 am

this is not really a bug, but on default policy config it caused me a lot of trouble so i am posting this in case other people encouter this.

when you turn on RBAC, using default policy file which was shipped with the package (not learning), and if rsyslog is enabled it will go up to 100% CPU (it loops trying to write some logs i think) and stay there until you stop the service/kill the process.

the problem is even if you turn off RBAC, the process will still remain there with 100% CPU until you stop the service/kill the process.

the interesting thing is that its not rsyslog causing the problem but /bin/dd, adding:
subject /bin/dd
+CAP_SYS_ADMIN
will fix the problem.

i think this is true for other syslog daemons, like klogd, etc.

i found the following dd that causes the problem(i think):
root 7814 1 0 03:29 ? 00:00:00 dd bs=1 if=/proc/kmsg of=/var/run/rsyslog/kmsg
lesnoland
 
Posts: 7
Joined: Thu May 14, 2009 6:06 am

Re: rsyslog 100% cpu

Postby biz » Mon Mar 01, 2010 8:56 pm

lesnoland wrote:when you turn on RBAC, using default policy file which was shipped with the package (not learning), and if rsyslog is enabled it will go up to 100% CPU (it loops trying to write some logs i think) and stay there until you stop the service/kill the process.


The "imklog" module needs read access for /proc/kmsg, that's the same reason why you can't drop privileges with rsyslog if you want kernel messages. The issue is known, the problem is handled badly (infinite loop trying to read from /proc/kmsg). See also http://wiki.rsyslog.com/index.php/Chroot_support#Problems :wink:
biz
 
Posts: 4
Joined: Mon Mar 01, 2010 8:04 pm

Re: rsyslog 100% cpu

Postby spender » Mon Mar 01, 2010 10:29 pm

I wouldn't recommend anyone add the subject to their policy from the original poster. Giving CAP_SYS_ADMIN to the dd binary to any root user (we have to assume an attacker) isn't a good idea. It'd be better to find out why it might need that privilege in certain circumstances and use nested subjects if it's necessary to run dd in such a way that it requires that privilege outside of the admin role.

-Brad
spender
 
Posts: 2185
Joined: Wed Feb 20, 2002 8:00 pm


Return to grsecurity support

cron