public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Sergio Arroutbi <sarroutb@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/clevis] f45: Add new sources (release 24)
Date: Wed, 21 Oct 2026 08:19:44 GMT [thread overview]
Message-ID: <179257078414.1.5779512492992817260.rpms-clevis-959e2efd61cb@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/clevis
Branch : f45
Commit : 959e2efd61cb4434086be785106e829649d80651
Author : Sergio Arroutbi <sarroutb@redhat.com>
Date : 2026-10-16T16:43:42+02:00
Stats : +203/-10 in 7 file(s)
URL : https://src.fedoraproject.org/rpms/clevis/c/959e2efd61cb4434086be785106e829649d80651?branch=f45
Log:
Add new sources (release 24)
Resolves: rhbz#2553530
Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
---
diff --git a/.gitignore b/.gitignore
index bb3b415..dda6661 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,4 +10,5 @@
/clevis-20.tar.xz
/clevis-21.tar.xz
/clevis-22.tar.xz
-/clevis-23.tar.xz
\ No newline at end of file
+/clevis-23.tar.xz
+/clevis-24.tar.xz
diff --git a/0001-Fix-truncation-errors-happening-when-O2-enabled.patch b/0001-Fix-truncation-errors-happening-when-O2-enabled.patch
new file mode 100644
index 0000000..63c34ef
--- /dev/null
+++ b/0001-Fix-truncation-errors-happening-when-O2-enabled.patch
@@ -0,0 +1,90 @@
+From c4b68e6f20a851f1d0b2a489a16ac38b2a7dda8e Mon Sep 17 00:00:00 2001
+From: Sergio Arroutbi <sarroutb@redhat.com>
+Date: Fri, 16 Oct 2026 10:19:29 +0200
+Subject: [PATCH] Fix truncation errors (happening when -O2 enabled)
+
+meson setup build defaults to --buildtype=debug which uses -O0.
+At this level, GCC doesn't perform deep enough data-flow analysis
+to detect that g_sock_file (1024 bytes) can exceed sock_addr.sun_path
+(108 bytes), so -Wstringop-truncation never fires.
+In other compilation scenarios, such as RPM build (centpkg),
+%meson uses --buildtype=plain with CFLAGS containing -O2.
+At this level, GCC tracks buffer sizes and sees the potential truncation
+Combined with -Werror from meson.build, it becomes a
+fatal error.
+
+Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
+---
+ .github/workflows/build.yml | 4 +++-
+ src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock.c | 12 ++++++++----
+ 2 files changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
+index 7ac4858..87e5a27 100644
+--- a/.github/workflows/build.yml
++++ b/.github/workflows/build.yml
+@@ -29,6 +29,8 @@ jobs:
+ stable: false
+ - os: ubuntu:devel
+ stable: false
++ - os: quay.io/centos/centos:stream10
++ extra_cflags: "-O2"
+ steps:
+ - uses: actions/checkout@v4
+
+@@ -43,7 +45,7 @@ jobs:
+ mkdir -p build && cd build
+ export ninja=$(command -v ninja)
+ [ -z "${ninja}" ] && export ninja=$(command -v ninja-build)
+- export CFLAGS="-g -coverage"
++ export CFLAGS="-g -coverage ${{ matrix.extra_cflags }}"
+ meson .. || cat meson-logs/meson-log.txt >&2
+ ${ninja}
+
+diff --git a/src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock.c b/src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock.c
+index c69af0e..833a798 100644
+--- a/src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock.c
++++ b/src/pins/pkcs11/clevis-pkcs11-afunix-socket-unlock.c
+@@ -44,6 +44,10 @@ const char* VERSION = "v0.0.1";
+ #define MAX_ENTRIES 1024
+ #define MAX_KEY 1024
+
++#ifndef UNIX_PATH_MAX
++#define UNIX_PATH_MAX (sizeof(((struct sockaddr_un *)0)->sun_path))
++#endif
++
+ const uint16_t DEFAULT_MAX_ITERATIONS = 3;
+ const uint16_t MAX_PATH = 1024;
+ const uint16_t MAX_CONTROL_MSG = 1024;
+@@ -62,8 +66,8 @@ volatile sig_atomic_t thread_loop = 1;
+ volatile sig_atomic_t control_thread_info = 0;
+ pthread_mutex_t mutex;
+ FILE* logfile = NULL;
+-static char g_sock_file[1024];
+-static char g_sock_control_file[1024];
++static char g_sock_file[UNIX_PATH_MAX];
++static char g_sock_control_file[UNIX_PATH_MAX];
+
+ static int
+ get_control_socket_name(const char* file_sock, char* control_sock, uint32_t control_sock_len) {
+@@ -110,7 +114,7 @@ static void* control_thread(void *targ) {
+ socklen_t len;
+ memset(&control_addr, 0, sizeof(control_addr));
+ control_addr.sun_family = AF_UNIX;
+- strncpy(control_addr.sun_path, control_sock, sizeof(control_addr.sun_path)-1);
++ snprintf(control_addr.sun_path, sizeof(control_addr.sun_path), "%s", control_sock);
+ unlink(control_sock);
+ s = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (s == -1) {
+@@ -301,7 +305,7 @@ int main(int argc, char* argv[]) {
+
+ memset(&sock_addr, 0, sizeof(sock_addr));
+ sock_addr.sun_family = AF_UNIX;
+- strncpy(sock_addr.sun_path, g_sock_file, sizeof(sock_addr.sun_path)-1);
++ snprintf(sock_addr.sun_path, sizeof(sock_addr.sun_path), "%s", g_sock_file);
+ s = socket(AF_UNIX, SOCK_STREAM, 0);
+ if (s == -1) {
+ perror("socket");
+--
+2.56.0
+
diff --git a/0002-pkcs11-test-non-root-rejection-in-afunix-socket-unlo.patch b/0002-pkcs11-test-non-root-rejection-in-afunix-socket-unlo.patch
new file mode 100644
index 0000000..0c9df0f
--- /dev/null
+++ b/0002-pkcs11-test-non-root-rejection-in-afunix-socket-unlo.patch
@@ -0,0 +1,60 @@
+From c3170a3594076c99a92f8c73cd485017a9d67641 Mon Sep 17 00:00:00 2001
+From: Sergio Arroutbi <sarroutb@redhat.com>
+Date: Fri, 16 Oct 2026 09:54:49 +0200
+Subject: [PATCH 1/2] pkcs11: test non-root rejection in afunix-socket-unlock
+ (#591)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The daemon enforces root-only access on its control and data
+sockets via SO_PEERCRED UID checks (security requirement for
+key material handling). Non-root connections are rejected but
+the daemon keeps running — this is the correct behavior.
+
+Previously the test assumed root and failed with EPIPE when run
+as a non-root user. Instead of skipping, verify the daemon
+rejects the connection, logs the caller's UID, and stays alive.
+Root users continue to run the full protocol test suite.
+
+Signed-off-by: Sergio Arroutbi <sarroutb@redhat.com>
+---
+ src/pins/pkcs11/tests/afunix-socket-unlock | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/src/pins/pkcs11/tests/afunix-socket-unlock b/src/pins/pkcs11/tests/afunix-socket-unlock
+index 54694a2..871d86f 100755
+--- a/src/pins/pkcs11/tests/afunix-socket-unlock
++++ b/src/pins/pkcs11/tests/afunix-socket-unlock
+@@ -34,7 +34,7 @@ SOCK="${TMP}/test.sock"
+ CONTROL_SOCK="${TMP}/test.control.sock"
+ LOG="${TMP}/daemon.log"
+
+-# Start daemon: 1 iteration, no start delay
++# Start daemon: 3 iterations, no start delay
+ clevis-pkcs11-afunix-socket-unlock \
+ -f "${SOCK}" -c "${CONTROL_SOCK}" -l "${LOG}" -t 3 -s 0 &
+ DAEMON_PID=$!
+@@ -43,6 +43,19 @@ sleep 1
+ # Verify daemon is running
+ kill -0 "${DAEMON_PID}"
+
++if [ "$(id -u)" != 0 ]; then
++ # --- Non-root: verify the daemon rejects connections and stays alive ---
++ echo -n "test-device,test-passphrase" | \
++ socat UNIX-CONNECT:"${CONTROL_SOCK}" - 2>/dev/null || true
++ sleep 1
++ kill -0 "${DAEMON_PID}"
++ grep "Rejected control connection from UID $(id -u)" "${LOG}"
++ echo "Non-root rejection test passed"
++ exit 0
++fi
++
++# --- Root tests below ---
++
+ # --- Test 1: normal device,passphrase ---
+ echo -n "test-device,test-passphrase" | \
+ socat UNIX-CONNECT:"${CONTROL_SOCK}" -
+--
+2.56.0
+
diff --git a/0003-include-setgroups-and-set-library-as-shared-mod.patch b/0003-include-setgroups-and-set-library-as-shared-mod.patch
new file mode 100644
index 0000000..29a73b0
--- /dev/null
+++ b/0003-include-setgroups-and-set-library-as-shared-mod.patch
@@ -0,0 +1,46 @@
+diff --git a/src/pins/tpm1/clevis-tpm1-tcsd-preload.c b/src/pins/tpm1/clevis-tpm1-tcsd-preload.c
+index cc32bde..e26c6f0 100644
+--- a/src/pins/tpm1/clevis-tpm1-tcsd-preload.c
++++ b/src/pins/tpm1/clevis-tpm1-tcsd-preload.c
+@@ -21,6 +21,7 @@
+ #define _GNU_SOURCE
+
+ #include <dlfcn.h>
++#include <grp.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
+@@ -64,6 +65,20 @@ setgid(gid_t gid)
+ }
+ }
+
++int
++setgroups(size_t size, const gid_t *list)
++{
++ static int (*real_setgroups)(size_t, const gid_t *) = NULL;
++ if (no_privilege_drop()) {
++ return 0;
++ } else {
++ if (!real_setgroups) {
++ real_setgroups = dlsym(RTLD_NEXT, "setgroups");
++ }
++ return real_setgroups(size, list);
++ }
++}
++
+ static void __attribute ((constructor))
+ set_line_buffering(void)
+ {
+diff --git a/src/pins/tpm1/meson.build b/src/pins/tpm1/meson.build
+index d9b6c5e..0b980c6 100644
+--- a/src/pins/tpm1/meson.build
++++ b/src/pins/tpm1/meson.build
+@@ -11,7 +11,7 @@ if all
+ mans += join_paths(meson.current_source_dir(), 'clevis-encrypt-tpm1.1')
+
+ libdl_dep = dependency('dl', required: false)
+- libclevis_tpm1_tcsd_preload = shared_library('clevis-tpm1-tcsd-preload', 'clevis-tpm1-tcsd-preload.c',
++ libclevis_tpm1_tcsd_preload = shared_module('clevis-tpm1-tcsd-preload', 'clevis-tpm1-tcsd-preload.c',
+ dependencies: libdl_dep,
+ install_dir: libdir,
+ install: true)
diff --git a/clevis.rpmlintrc b/clevis.rpmlintrc
index 89d4d11..390bc92 100644
--- a/clevis.rpmlintrc
+++ b/clevis.rpmlintrc
@@ -1,9 +1,3 @@
-# libclevis-tpm1-tcsd-preload.so is an LD_PRELOAD library that intercepts
-# setuid/setgid calls to prevent tcsd from dropping privileges. It is not
-# a linkable shared library and does not perform real privilege transitions.
-addFilter("invalid-soname")
-addFilter("missing-call-to-setgroups-before-setuid")
-
# clevis-dracut, clevis-luks, and clevis-systemd contain only shell scripts
# and systemd units.
addFilter("no-binary")
diff --git a/clevis.spec b/clevis.spec
index abb2cbf..a7444a5 100644
--- a/clevis.spec
+++ b/clevis.spec
@@ -1,7 +1,7 @@
%global dracut_prio 50
Name: clevis
-Version: 23
+Version: 24
Release: %autorelease
Summary: Automated decryption framework
@@ -10,7 +10,9 @@ URL: https://github.com/latchset/%{name}
Source0: https://github.com/latchset/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.xz
Source1: clevis.sysusers
-Patch0001: 0001-add-force-password-to-cryptsetup-luksChangeKey.patch
+Patch0001: 0001-Fix-truncation-errors-happening-when-O2-enabled.patch
+Patch0002: 0002-pkcs11-test-non-root-rejection-in-afunix-socket-unlo.patch
+Patch0003: 0003-include-setgroups-and-set-library-as-shared-mod.patch
BuildRequires: git-core
BuildRequires: gcc
diff --git a/sources b/sources
index 82cd36b..e367b8e 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (clevis-23.tar.xz) = e5b66682f197ab4db42bac4377e3cc293e0a4cfcd1ed5b0e87a7b67e0c0724c774455f182eb54f26f3f459454aa4eb2890f3054e543bb2a7fcce1a86db98b8fa
\ No newline at end of file
+SHA512 (clevis-24.tar.xz) = 9fe9291a71681af1c9c3d95cc8df35ee00e515922f70ce87ddaf648196e333830717cde30ac3ecbcccc49028dd1f1e6f0e20edeab98e7f763042e44685b1cf79
reply other threads:[~2026-10-21 8:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179257078414.1.5779512492992817260.rpms-clevis-959e2efd61cb@fedoraproject.org \
--to=sarroutb@redhat.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox