0003-apparmor-fix-apparmor-mediating-locking-non-fs-unix-sockets.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From d7410054784d8aa0e313f9eeb6110a791420f3d3 Mon Sep 17 00:00:00 2001
  2. From: John Johansen <[email protected]>
  3. Date: Mon, 30 Jul 2018 13:55:30 -0700
  4. Subject: UBUNTU SAUCE: apparmor: fix apparmor mediating locking non-fs, unix
  5. sockets
  6. The apparmor policy language current does not allow expressing of the
  7. locking permission for no-fs unix sockets. However the kernel is
  8. enforcing mediation.
  9. Add the AA_MAY_LOCK perm to the computed perm mask which will grant
  10. permission for all current abi profiles, but still allow specifying
  11. auditing of the operation if needed.
  12. BugLink: http://bugs.launchpad.net/bugs/1780227
  13. Signed-off-by: John Johansen <[email protected]>
  14. Acked-by: Acked-by: Stefan Bader <[email protected]>
  15. Acked-by: Acked-by: Kleber Sacilotto de Souza <[email protected]>
  16. Signed-off-by: Seth Forshee <[email protected]>
  17. ---
  18. security/apparmor/lib.c | 2 +-
  19. 1 file changed, 1 insertion(+), 1 deletion(-)
  20. (limited to 'security/apparmor')
  21. diff --git a/security/apparmor/lib.c b/security/apparmor/lib.c
  22. index fa49b81..bf72843 100644
  23. --- a/security/apparmor/lib.c
  24. +++ b/security/apparmor/lib.c
  25. @@ -334,7 +334,7 @@ void aa_compute_perms(struct aa_dfa *dfa, unsigned int state,
  26. /* for v5 perm mapping in the policydb, the other set is used
  27. * to extend the general perm set
  28. */
  29. - perms->allow |= map_other(dfa_other_allow(dfa, state));
  30. + perms->allow |= map_other(dfa_other_allow(dfa, state)) | AA_MAY_LOCK;
  31. perms->audit |= map_other(dfa_other_audit(dfa, state));
  32. perms->quiet |= map_other(dfa_other_quiet(dfa, state));
  33. // perms->xindex = dfa_user_xindex(dfa, state);