summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2015-12-04 12:59:45 -0600
committerMark Salyzyn2015-12-08 18:46:29 -0600
commit083b037c0740ca00f72429e4457bfdd4b4d4dfa7 (patch)
tree6748f9f8bcaebd495df77604dfeba68e0b65b5be /logd/LogListener.cpp
parentcb3e6ef15459388fc8fee2b4a3157ff0eac0714a (diff)
downloadplatform-system-core-083b037c0740ca00f72429e4457bfdd4b4d4dfa7.tar.gz
platform-system-core-083b037c0740ca00f72429e4457bfdd4b4d4dfa7.tar.xz
platform-system-core-083b037c0740ca00f72429e4457bfdd4b4d4dfa7.zip
logd: liblog: logcat: Add LOG_ID_SECURITY
- Largish commit, buffer and access controls done together - Add LOG_ID_SECURITY binary content log - Add "default" meta buffer - allow LOG_ID_SECURITY only from AID_SYSTEM and AID_ROOT UID & GID - Use __android_log_security() to gate logging - Add __android_log_security_bwrite() native access to security logging. - Add liblog.__security_buffer end-to-end gTest Bug: 26029733 Change-Id: Ibcf5b4660c17c1aa6902c0d93f8ffd29c93d9a93
Diffstat (limited to 'logd/LogListener.cpp')
-rw-r--r--logd/LogListener.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/logd/LogListener.cpp b/logd/LogListener.cpp
index b29f5ab92..9bbf9e84b 100644
--- a/logd/LogListener.cpp
+++ b/logd/LogListener.cpp
@@ -27,6 +27,7 @@
27#include <private/android_logger.h> 27#include <private/android_logger.h>
28 28
29#include "LogListener.h" 29#include "LogListener.h"
30#include "LogUtils.h"
30 31
31LogListener::LogListener(LogBuffer *buf, LogReader *reader) : 32LogListener::LogListener(LogBuffer *buf, LogReader *reader) :
32 SocketListener(getLogSocket(), false), 33 SocketListener(getLogSocket(), false),
@@ -92,6 +93,12 @@ bool LogListener::onDataAvailable(SocketClient *cli) {
92 return false; 93 return false;
93 } 94 }
94 95
96 if ((header->id == LOG_ID_SECURITY) &&
97 (!__android_log_security() ||
98 !clientHasLogCredentials(cred->uid, cred->gid, cred->pid))) {
99 return false;
100 }
101
95 char *msg = ((char *)buffer) + sizeof(android_log_header_t); 102 char *msg = ((char *)buffer) + sizeof(android_log_header_t);
96 n -= sizeof(android_log_header_t); 103 n -= sizeof(android_log_header_t);
97 104