blob: 4ad9adc5c2a42d7ada1b8050e7706b5618af2c9a [file] [log] [blame]
From 7432f583674294b676577b6505b89fc74dc5c7ab Mon Sep 17 00:00:00 2001
From: Kienan Stewart <kstewart@efficios.com>
Date: Mon, 22 Jan 2024 11:47:40 -0500
Subject: [PATCH 3/5] Fix: strlcopy removed in linux 6.8.0-rc1
See upstream commit:
commit d26270061ae66b915138af7cd73ca6f8b85e6b44
Author: Kees Cook <keescook@chromium.org>
Date: Thu Jan 18 12:31:55 2024 -0800
string: Remove strlcpy()
With all the users of strlcpy() removed[1] from the kernel, remove the
API, self-tests, and other references. Leave mentions in Documentation
(about its deprecation), and in checkpatch.pl (to help migrate host-only
tools/ usage). Long live strscpy().
Upstream-Status: Backport [Uhttps://review.lttng.org/c/lttng-modules/+/11700]
Change-Id: I27cdff70a504b25340cc59150ed8e959d9629e43
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
src/lib/ringbuffer/ring_buffer_backend.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/lib/ringbuffer/ring_buffer_backend.c b/src/lib/ringbuffer/ring_buffer_backend.c
index 9a339be..2181145 100644
--- a/src/lib/ringbuffer/ring_buffer_backend.c
+++ b/src/lib/ringbuffer/ring_buffer_backend.c
@@ -405,7 +405,11 @@ int channel_backend_init(struct channel_backend *chanb,
chanb->extra_reader_sb =
(config->mode == RING_BUFFER_OVERWRITE) ? 1 : 0;
chanb->num_subbuf = num_subbuf;
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,8,0))
+ strscpy(chanb->name, name, NAME_MAX);
+#else
strlcpy(chanb->name, name, NAME_MAX);
+#endif
memcpy(&chanb->config, config, sizeof(chanb->config));
if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
--
2.39.2