[lxc-devel] [lxc/master] seccomp: document path calculation

brauner on Github lxc-bot at linuxcontainers.org
Mon May 6 07:40:25 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 364 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20190506/3d83c49e/attachment.bin>
-------------- next part --------------
From 18847d37dda145539a28c1dea291af03ec810163 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Mon, 6 May 2019 09:39:40 +0200
Subject: [PATCH] seccomp: document path calculation

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 src/lxc/seccomp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/lxc/seccomp.c b/src/lxc/seccomp.c
index bfbc19ac53..96ad03ff0b 100644
--- a/src/lxc/seccomp.c
+++ b/src/lxc/seccomp.c
@@ -1338,7 +1338,10 @@ int seccomp_notify_handler(int fd, uint32_t events, void *data,
 	__do_close_prot_errno int fd_mem = -EBADF;
 	int reconnect_count, ret;
 	ssize_t bytes;
-	char mem_path[6 + 21 + 5];
+	char mem_path[6 /* /proc/ */
+		      + INTTYPE_TO_STRLEN(int64_t)
+		      + 3 /* mem */
+		      + 1 /* \0 */];
 	struct lxc_handler *hdlr = data;
 	struct lxc_conf *conf = hdlr->conf;
 	struct seccomp_notif *req = conf->seccomp.notifier.req_buf;


More information about the lxc-devel mailing list