netd: Enable the SO_PASSCRED socket option

Ensure that sender credentials are available when we
receive a netlink message.

Change-Id: I8a352573c7e49d99b4f2fdb2e4ce9abe58d4fc49
diff --git a/NetlinkManager.cpp b/NetlinkManager.cpp
index 634fd4d..e7f0c7b 100644
--- a/NetlinkManager.cpp
+++ b/NetlinkManager.cpp
@@ -50,6 +50,7 @@
 int NetlinkManager::start() {
     struct sockaddr_nl nladdr;
     int sz = 64 * 1024;
+    int on = 1;
 
     memset(&nladdr, 0, sizeof(nladdr));
     nladdr.nl_family = AF_NETLINK;
@@ -63,7 +64,12 @@
     }
 
     if (setsockopt(mSock, SOL_SOCKET, SO_RCVBUFFORCE, &sz, sizeof(sz)) < 0) {
-        LOGE("Unable to set uevent socket options: %s", strerror(errno));
+        LOGE("Unable to set uevent socket SO_RCVBUFFORCE option: %s", strerror(errno));
+        return -1;
+    }
+
+    if (setsockopt(mSock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)) < 0) {
+        SLOGE("Unable to set uevent socket SO_PASSCRED option: %s", strerror(errno));
         return -1;
     }