Comment 34 for bug 523610

Revision history for this message
Rocko (rockorequin) wrote :

I confirm Gianvito's findings with 2.6.33.2, ie that the problem is NOT resolved. rsyslog isn't using up CPU cycles, but it is failing to read kmsg.

What I suspect is happening is that attempting a zero-byte read from ksmg always succeeds, so rsyslog is using the wrong test, eg:

sudo python
>>> import os
>>> f=open('/proc/kmsg')
>>> os.seteuid(1000)
>>> f.read(0)
''
>>> f.read(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IOError: [Errno 1] Operation not permitted

ie rsyslog should try and read at least one byte for its test whether the user can read /proc/kmsg.

Oddly, it looks like the patch (see comment 1 in bug #515623) to allow user "read file" access to /proc/kmsg is incorporated in 2.6.33.2, but it simply isn't working.