crun: patch CVE-2026-88264
PATCH 1/1 crun: patch CVE-2026-88264
From: Peter Marko <[email protected]>
Pick patch referencing this CVE.
Additioanlly pick a refactoring patch to apply it cleanly.
Signed-off-by Peter Marko <[email protected]>
--- .../crun/crun/CVE-2026-88264-01.patch | 124 ++++++++++++++++++ .../crun/crun/CVE-2026-88264-02.patch | 104 +++++++++++++++ recipes-containers/crun/crun_git.bb | 2 + 3 files changed, 230 insertions(+) create mode 100644 recipes-containers/crun/crun/CVE-2026-88264-01.patch create mode 100644 recipes-containers/crun/crun/CVE-2026-88264-02.patch
recipes-containers/crun/crun/CVE-2026-88264-01.patch new file +124 -0
@@ -0,0 +1,124 @@ +From 490d550204f22765d04dd012f51f1bf74b8c4543 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Erik=20Sj=C3=B6lund?= <[email protected]> +Date: Wed, 29 Jan 2025 18:42:02 +0100 +Subject: [PATCH] linux, utils: remove dead code crun_ensure_file*() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Remove dead code. + +Use 0620 instead of 0700 as mode +for the new file. + +Signed-off-by: Erik Sjölund <[email protected]> + +CVE: CVE-2026-88264 +Upstream-Status: Backport [https://github.com/containers/crun/commit/490d550204f22765d04dd012f51f1bf74b8c4543] +Signed-off-by: Peter Marko <[email protected]> +--- + src/libcrun/linux.c | 2 +- + src/libcrun/utils.c | 37 +++++-------------------------------- + src/libcrun/utils.h | 6 +----- + 3 files changed, 7 insertions(+), 38 deletions(-) + +diff --git a/src/libcrun/linux.c b/src/libcrun/linux.c +index acfb5b0b..6ecbaaac 100644 +--- a/src/libcrun/linux.c ++++ b/src/libcrun/linux.c +@@ -1836,7 +1836,7 @@ create_missing_devs (libcrun_container_t *container, bool binds, libcrun_error_t + + if (container->container_def->process && container->container_def->process->terminal) + { +- ret = crun_ensure_file_at (devfd, "console", 0620, true, err); ++ ret = create_file_if_missing_at (devfd, "console", 0620, err); + if (UNLIKELY (ret < 0)) + return ret; + } +diff --git a/src/libcrun/utils.c b/src/libcrun/utils.c +index fd40110a..38d86c82 100644 +--- a/src/libcrun/utils.c ++++ b/src/libcrun/utils.c +@@ -242,17 +242,17 @@ get_file_type (mode_t *mode, bool nofollow, const char *path) + } + + int +-create_file_if_missing_at (int dirfd, const char *file, libcrun_error_t *err) ++create_file_if_missing_at (int dirfd, const char *file, mode_t mode, libcrun_error_t *err) + { +- cleanup_close int fd_write = openat (dirfd, file, O_CLOEXEC | O_CREAT | O_WRONLY, 0700); ++ cleanup_close int fd_write = openat (dirfd, file, O_CLOEXEC | O_CREAT | O_WRONLY, mode); + if (fd_write < 0) + { +- mode_t mode; ++ mode_t tmp_mode; + int ret; + + /* On errors, check if the file already exists. */ +- ret = get_file_type_at (dirfd, &mode, false, file); +- if (ret == 0 && S_ISREG (mode)) ++ ret = get_file_type_at (dirfd, &tmp_mode, false, file); ++ if (ret == 0 && S_ISREG (tmp_mode)) + return 0; + + return crun_make_error (err, errno, "creating file `%s`", file); +@@ -635,33 +635,6 @@ crun_ensure_directory (const char *path, int mode, bool nofollow, libcrun_error_ + return crun_ensure_directory_at (AT_FDCWD, path, mode, nofollow, err); + } + +-int +-crun_ensure_file_at (int dirfd, const char *path, int mode, bool nofollow, libcrun_error_t *err) +-{ +- cleanup_free char *tmp = xstrdup (path); +- size_t len = strlen (tmp); +- char *it = tmp + len - 1; +- int ret; +- +- while (*it != '/' && it > tmp) +- it--; +- if (it > tmp) +- { +- *it = '\0'; +- ret = crun_ensure_directory_at (dirfd, tmp, mode, nofollow, err); +- if (UNLIKELY (ret < 0)) +- return ret; +- *it = '/'; +- } +- return create_file_if_missing_at (dirfd, tmp, err); +-} +- +-int +-crun_ensure_file (const char *path, int mode, bool nofollow, libcrun_error_t *err) +-{ +- return crun_ensure_file_at (AT_FDCWD, path, mode, nofollow, err); +-} +- + static int + get_file_size (int fd, off_t *size) + { +diff --git a/src/libcrun/utils.h b/src/libcrun/utils.h +index ed83344e..0025648f 100644 +--- a/src/libcrun/utils.h ++++ b/src/libcrun/utils.h +@@ -265,12 +265,8 @@ int write_file_at_with_flags (int dirfd, int flags, mode_t mode, const char *nam + + int crun_ensure_directory (const char *path, int mode, bool nofollow, libcrun_error_t *err); + +-int crun_ensure_file (const char *path, int mode, bool nofollow, libcrun_error_t *err); +- + int crun_ensure_directory_at (int dirfd, const char *path, int mode, bool nofollow, libcrun_error_t *err); + +-int crun_ensure_file_at (int dirfd, const char *path, int mode, bool nofollow, libcrun_error_t *err); +- + int crun_safe_create_and_open_ref_at (bool dir, int dirfd, const char *dirpath, size_t dirpath_len, const char *path, int mode, libcrun_error_t *err); + + int crun_safe_ensure_directory_at (int dirfd, const char *dirpath, size_t dirpath_len, const char *path, int mode, +@@ -285,7 +281,7 @@ int crun_dir_p_at (int dirfd, const char *path, bool nofollow, libcrun_error_t * + + int detach_process (); + +-int create_file_if_missing_at (int dirfd, const char *file, libcrun_error_t *err); ++int create_file_if_missing_at (int dirfd, const char *file, mode_t mode, libcrun_error_t *err); + + int check_running_in_user_namespace (libcrun_error_t *err); +
recipes-containers/crun/crun/CVE-2026-88264-02.patch new file +104 -0
104 lines not on this page · raw message
recipes-containers/crun/crun_git.bb +2 -0
@@ -16,6 +16,8 @@ SRC_URI = "git://github.com/containers/crun.git;branch=main;name=crun;protocol=h git://github.com/opencontainers/image-spec.git;branch=main;name=ispec;destsuffix=git/libocispec/image-spec;protocol=https \ git://github.com/containers/yajl.git;branch=main;name=yajl;destsuffix=git/libocispec/yajl;protocol=https \ file://CVE-2025-24965.patch \ + file://CVE-2026-88264-01.patch \ + file://CVE-2026-88264-02.patch \ " PV = "v1.14.3+git${SRCREV_crun}"
merged
Bruce
Hi Bruce,
Could you also merge this CVE patch for wrynose or should I resend it?
https://lists.yoctoproject.org/g/meta-virtualization/message/10096
Peter
Quoted 10 lines
-----Original Message-----
From: Bruce Ashfield <[email protected]>
Sent: Sunday, October 4, 2026 3:35 AM
To: [email protected]
Cc: Marko, Peter (FT D EU SK BFS1) <[email protected]>
Subject: Re: [meta-virtualization][scarthgap][PATCH] crun: patch CVE-2026-88264merged
Bruce
merged -- apologies for missing the wrynose counterpart in the earlier triage.
Bruce