Skip to content
Snippets Groups Projects
Commit 8a224775 authored by Erik Kline's avatar Erik Kline
Browse files

Allow clatd CAP_IPC_LOCK for mmap()

clatd's environment may not have a sufficiently large memlock
ulimit; it needs >=1MB but values much lower can be encountered.

The mmap() is performed while clatd is still root, before dropping
privileges; allow this to succeed.

Bug: 21736319
Change-Id: I8171e077046566924c769e855144ae5fac634d4c
parent 4b4c5645
No related branches found
No related tags found
No related merge requests found
...@@ -19,11 +19,12 @@ allow clatd self:capability { net_admin net_raw setuid setgid }; ...@@ -19,11 +19,12 @@ allow clatd self:capability { net_admin net_raw setuid setgid };
# clatd calls mmap(MAP_LOCKED) with a 1M buffer. MAP_LOCKED first checks # clatd calls mmap(MAP_LOCKED) with a 1M buffer. MAP_LOCKED first checks
# capable(CAP_IPC_LOCK), and then checks to see the requested amount is # capable(CAP_IPC_LOCK), and then checks to see the requested amount is
# under RLIMIT_MEMLOCK. The latter check succeeds. As a result, clatd # under RLIMIT_MEMLOCK. If the latter check succeeds clatd won't have
# does not need CAP_IPC_LOCK, so we suppress any denials we see # needed CAP_IPC_LOCK. But this is not guaranteed to succeed on all devices
# from clatd asking for this capability. # so we permit any requests we see from clatd asking for this capability.
# See https://android-review.googlesource.com/127940 # See https://android-review.googlesource.com/127940 and
dontaudit clatd self:capability ipc_lock; # https://b.corp.google.com/issues/21736319
allow clatd self:capability ipc_lock;
allow clatd self:netlink_route_socket nlmsg_write; allow clatd self:netlink_route_socket nlmsg_write;
allow clatd self:{ packet_socket rawip_socket tun_socket } create_socket_perms; allow clatd self:{ packet_socket rawip_socket tun_socket } create_socket_perms;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment