dovecot imap broken by apparmor policy
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apparmor (Debian) |
Fix Released
|
Unknown
|
|||
apparmor (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
dovecot (Ubuntu) |
Invalid
|
High
|
Unassigned |
Bug Description
Syslog output:
Apr 29 10:59:06 host12 dovecot: imap(foobar): Error: fcntl(unlock) locking failed for file /home/foobar/
Apr 29 10:59:06 host12 dovecot: imap(foobar): Error: fstat() failed with file /home/foobar/
Apr 29 10:59:37 dovecot: last message repeated 122 times
Apr 29 11:00:38 dovecot: last message repeated 248 times
Apr 29 11:01:54 dovecot: last message repeated 203 times
audit.log, lots of entries similar to the following:
type=AVC msg=audit(
The apparmor policy is as shipped with 12.04. The strange thing here is that audit.log says that the access was allowed and the apparmor policy has "flags=(complain)", but the imap server still fails accessing some files in the Maildir folders.
Workaround:
# ln -s /etc/apparmor.
After disabling the usr.sbin.dovecot apparmor policy everything works fine. There is no need to disable the "usr.lib.
It looks like the imap process is incorrectly running under the dovecot main daemon's apparmor profile. And for some odd reason the profile is enforcing things even though it should be in "complain" mode. What are these "//null-NNN/" strings in the logged apparmor profile name? I do not know apparmor well enough to debug this further at this point.
Someone else has encountered this also, see thread at:
http://
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: dovecot-imapd 1:2.0.19-0ubuntu1
ProcVersionSign
Uname: Linux 3.2.0-24-virtual x86_64
ApportVersion: 2.0.1-0ubuntu7
Architecture: amd64
Date: Wed May 9 18:36:11 2012
ProcEnviron:
SHELL=/bin/bash
TERM=screen
LANG=en_US.UTF-8
SourcePackage: dovecot
UpgradeStatus: Upgraded to precise on 2012-04-27 (12 days ago)
---
ApportVersion: 2.0.1-0ubuntu8
Architecture: amd64
DistroRelease: Ubuntu 12.04
InstallationMedia: Ubuntu-Server 12.04 LTS "Precise Pangolin" - Release amd64 (20120424.1)
Package: apparmor 2.7.102-0ubuntu3.1
PackageArchitec
ProcEnviron:
TERM=linux
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcKernelCmdline: BOOT_IMAGE=
ProcVersionSign
Tags: precise
Uname: Linux 3.2.0-23-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:
Changed in dovecot (Ubuntu): | |
importance: | Undecided → High |
Changed in apparmor (Ubuntu): | |
status: | Expired → Confirmed |
Changed in apparmor (Debian): | |
status: | Unknown → Confirmed |
Changed in apparmor (Ubuntu): | |
status: | Expired → Incomplete |
Changed in apparmor (Ubuntu): | |
status: | Incomplete → Fix Released |
Changed in apparmor (Debian): | |
status: | Confirmed → Fix Released |
This looks like it could be an apparmor bug instead of dovecot bug, it just happens to manifest itself with dovecot. Adding "apparmor" in "affects".