apparmor: fix apparmor mediating locking non-fs, unix sockets

[ Upstream commit 1cf26c3d2c4c2098e39a9905174d7842b531e693 ]

the v8 and earlier policy does not encode the locking permission for
no-fs unix sockets. However the kernel is enforcing mediation.

Add the AA_MAY_LOCK perm to v8 and earlier computed perm mask which will
grant permission for all current abi profiles, but still allow specifying
auditing of the operation if needed.

Based-on-a-patch-by: Georgia Garcia <georgia.garcia@canonical.com>
Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1052130
Link: http://bugs.launchpad.net/bugs/1780227
Fixes: 56974a6fcfef ("apparmor: add base infastructure for socket mediation")
[ jj: backport to v6.1 by carrying policy version number in policydb and
  pushing permission version check into aa_compute_perms() and pushing
  version number through to calls of aa_compute_perms(). ]
Signed-off-by: John Johansen <john.johansen@canonical.com>
7 files changed