Log contains unknown mode senw
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
AppArmor |
Fix Released
|
Undecided
|
Christian Boltz | ||
2.10 |
Fix Released
|
Undecided
|
Christian Boltz | ||
apparmor (Ubuntu) |
Fix Released
|
Medium
|
Tyler Hicks | ||
Xenial |
Fix Released
|
Medium
|
Tyler Hicks |
Bug Description
[Impact]
AppArmor policy developers cannot use aa-logprof without it exiting with a traceback on certain denial messages.
[Test Case]
$ echo 'type=AVC msg=audit(
operation=
laddr=:
family="inet6" sock_type="stream" protocol=6 requested_
denied_mask="send"' > /tmp/log
$ mkdir -p /tmp/profiles && printf "profile foo {\n}" > /tmp/profiles/foo
$ aa-logprof -f /tmp/log -d /tmp/profiles
Expected output of the last command is:
Reading log entries from /tmp/log.
Updating AppArmor profiles in /tmp/profiles.
[Regression Potential]
There is little potential for regression. This "hotfix" could result in some slight confusion because the problematic denial messages will simply be ignored but it allows aa-logprof to do its intended job without unexpectedly exiting.
[Original Report]
Ref #1243932. Same title but appears to be different cause.
Ubuntu 16.04. Error thrown on 'sudo aa-logprof'
Python 3.5.1+: /usr/bin/python3
Mon May 16 20:13:30 2016
A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.
/usr/sbin/
42
43 if profiledir:
44 apparmor.
45 if not os.path.
46 raise apparmor.
47
48 apparmor.
49
50 apparmor.
51
apparmor = <module 'apparmor.aa' from '/usr/lib/
apparmor.
logmark = ''
/usr/lib/
2184 ## repo_cfg = read_config(
2185 ## if not repo_cfg[
2186 ## UI_ask_
2187
2188 log_reader = apparmor.
2189 log = log_reader.
2190 #read_log(logmark)
2191
2192 for root in log:
2193 handle_children('', '', root)
global log = [[['path', 13697, 'null-complain-
log_reader = <apparmor.
log_reader.read_log = <bound method ReadLog.read_log of <apparmor.
logmark = ''
/usr/lib/
402 self.add_
403 except AppArmorException as e:
404 ex_msg = ('%(msg)s\n\nThis error was caused by the log line:\n%(logline)s' %
405 {'msg': e.value, 'logline': line})
406 # when py3 only: Drop the original AppArmorException by passing None as the parent exception
407 raise AppArmorBug(ex_msg) # py3-only: from None
408
409 self.LOG.close()
410 self.logmark = ''
411 return self.log
global AppArmorBug = <class 'apparmor.
ex_msg = 'Log contains unknown mode senw\n\nThis error was c...otocol=6 requested_
AppArmorBug: Log contains unknown mode senw
This error was caused by the log line:
type=AVC msg=audit(
__cause__ = None
__class__ = <class 'apparmor.
__context__ = AppArmorExcepti
__delattr__ = <method-wrapper '__delattr__' of AppArmorBug object>
__dict__ = {}
__dir__ = <built-in method __dir__ of AppArmorBug object>
__doc__ = 'This class represents AppArmor exceptions "that should never happen"'
__eq__ = <method-wrapper '__eq__' of AppArmorBug object>
__format__ = <built-in method __format__ of AppArmorBug object>
__ge__ = <method-wrapper '__ge__' of AppArmorBug object>
__getattrib
__gt__ = <method-wrapper '__gt__' of AppArmorBug object>
__hash__ = <method-wrapper '__hash__' of AppArmorBug object>
__init__ = <method-wrapper '__init__' of AppArmorBug object>
__le__ = <method-wrapper '__le__' of AppArmorBug object>
__lt__ = <method-wrapper '__lt__' of AppArmorBug object>
__module__ = 'apparmor.common'
__ne__ = <method-wrapper '__ne__' of AppArmorBug object>
__new__ = <built-in method __new__ of type object>
__reduce__ = <built-in method __reduce__ of AppArmorBug object>
__reduce_ex__ = <built-in method __reduce_ex__ of AppArmorBug object>
__repr__ = <method-wrapper '__repr__' of AppArmorBug object>
__setattr__ = <method-wrapper '__setattr__' of AppArmorBug object>
__setstate__ = <built-in method __setstate__ of AppArmorBug object>
__sizeof__ = <built-in method __sizeof__ of AppArmorBug object>
__str__ = <method-wrapper '__str__' of AppArmorBug object>
__subclassh
__suppress_
__traceback__ = <traceback object>
__weakref__ = None
args = ('Log contains unknown mode senw\n\nThis error was c...otocol=6 requested_
with_traceback = <built-in method with_traceback of AppArmorBug object>
The above is a description of an error in a Python program. Here is
the original traceback:
Traceback (most recent call last):
File "/usr/lib/
self.
File "/usr/lib/
e = self.parse_
File "/usr/lib/
raise AppArmorExcepti
apparmor.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/sbin/
apparmor.
File "/usr/lib/
log = log_reader.
File "/usr/lib/
raise AppArmorBug(ex_msg) # py3-only: from None
apparmor.
This error was caused by the log line:
type=AVC msg=audit(
description: | updated |
Changed in apparmor (Ubuntu): | |
importance: | Undecided → Medium |
Changed in apparmor (Ubuntu Xenial): | |
importance: | Undecided → Medium |
assignee: | nobody → Tyler Hicks (tyhicks) |
Changed in apparmor (Ubuntu): | |
assignee: | nobody → Tyler Hicks (tyhicks) |
Changed in apparmor (Ubuntu Xenial): | |
status: | Confirmed → In Progress |
Changed in apparmor: | |
status: | Fix Committed → Fix Released |
This is mostly a duplicate of bug 1577051, except that your log message contains "send" instead of "receive" ;-)