summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-01-04 07:38:37 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-01-07 14:14:07 +0200
commita0c31b2ca39fdf06364553194ce725c4912265b3 (patch)
tree7acff7fb2ac43f89b98d7911c9a2167fcbf01d5b
parentabce49655af00e2cfbdfba8cdf2a68d68345f2a1 (diff)
libcamera: ipc_unixsocket: Don't send uninitialized bytes over the socket
IPCUnixSocket::send() sends a IPCUnixSocket::Header allocated on the stack. All the fields of the header are initialized, but the padding bytes are not. This results in random data being sent over the UNIX socket, potentially leaking information. Fix this by initializing the whole header to 0. Fixes: 13dd7a01ecbe ("libcamera: ipc: unix: Add a IPC mechanism based on Unix sockets") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
-rw-r--r--src/libcamera/ipc_unixsocket.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcamera/ipc_unixsocket.cpp b/src/libcamera/ipc_unixsocket.cpp
index def08eef..eb1a5023 100644
--- a/src/libcamera/ipc_unixsocket.cpp
+++ b/src/libcamera/ipc_unixsocket.cpp
@@ -172,7 +172,7 @@ int IPCUnixSocket::send(const Payload &payload)
if (!isBound())
return -ENOTCONN;
- Header hdr;
+ Header hdr = {};
hdr.data = payload.data.size();
hdr.fds = payload.fds.size();