Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
7bf58dd3d2
!30 Fix CVE-2025-24965
From: @zhihang161013 
Reviewed-by: @wonleing 
Signed-off-by: @wonleing
2025-04-09 03:05:04 +00:00
zhihang
ba79d77e62 Fix CVE-2025-24965 2025-03-12 02:14:23 +00:00
openeuler-ci-bot
f89ebe9755
!23 [sync] PR-22: Disable criu dependency for riscv
From: @openeuler-sync-bot 
Reviewed-by: @yangzhao_kl 
Signed-off-by: @yangzhao_kl
2024-05-07 04:38:22 +00:00
Yinsist
33c2c59f95 Disable criu dependency for RISC-V as criu does not currently support RISC-V
(cherry picked from commit c162f227745c0d9f9edc37b932ebc9c43e254d69)
2024-04-29 18:22:05 +08:00
openeuler-ci-bot
0125054682
!19 update to 1.8.7
From: @jianli-97 
Reviewed-by: @yangzhao_kl 
Signed-off-by: @yangzhao_kl
2024-04-26 01:01:42 +00:00
jianli-97
47f7678a44 update to 1.8.7 2024-04-25 11:55:40 +08:00
openeuler-ci-bot
52ff5ce17f
!16 linux: readonlyPaths should inherit flags from parent mount
From: @ayomi 
Reviewed-by: @duyiwei7w, @yangzhao_kl 
Signed-off-by: @yangzhao_kl
2024-04-18 02:03:03 +00:00
ayomi
e8058178d3 linux: readonlyPaths should inherit flags from parent mount 2024-04-17 14:23:53 +08:00
openeuler-ci-bot
dd4a9dbb64
!14 update to 1.8.1
From: @zmr_2020 
Reviewed-by: @biannm 
Signed-off-by: @biannm
2023-05-10 08:08:11 +00:00
zmr_2020
7c5a3432a4 update to 1.8.1 2023-05-10 10:04:22 +08:00
4 changed files with 83 additions and 8 deletions

41
0001-CVE-2025-24965.patch Normal file
View File

@ -0,0 +1,41 @@
From b79b4ba532316faa0b4147bc4edb5e6f14f5f18d Mon Sep 17 00:00:00 2001
From: zhihang <zhihang161013@outlook.com>
Date: Fri, 7 Mar 2025 02:22:00 +0000
Subject: [PATCH] CVE-2025-24965
Signed-off-by: zhihang <zhihang161013@outlook.com>
---
src/libcrun/handlers/krun.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/libcrun/handlers/krun.c b/src/libcrun/handlers/krun.c
index 0342a33..2437967 100644
--- a/src/libcrun/handlers/krun.c
+++ b/src/libcrun/handlers/krun.c
@@ -43,6 +43,8 @@
/* libkrun has a hard-limit of 8 vCPUs per microVM. */
#define LIBKRUN_MAX_VCPUS 8
+#define KRUN_CONFIG_FILE ".krun_config.json"
+
struct krun_config
{
void *handle;
@@ -207,7 +209,13 @@ libkrun_configure_container (void *cookie, enum handler_configure_phase phase,
if (UNLIKELY (ret < 0))
return ret;
- ret = write_file_at (rootfsfd, ".krun_config.json", config, config_size, err);
+ /* CVE-2025-24965: the content below rootfs cannot be trusted because it is controlled by the user. We
+ must ensure the file is opened below the rootfs directory. */
+ fd = safe_openat (rootfsfd, rootfs, KRUN_CONFIG_FILE, WRITE_FILE_DEFAULT_FLAGS | O_NOFOLLOW, 0700, err);
+ if (UNLIKELY (fd < 0))
+ return fd;
+
+ ret = safe_write (fd, KRUN_CONFIG_FILE, config, config_size, err);
if (UNLIKELY (ret < 0))
return ret;
}
--
2.43.0

Binary file not shown.

BIN
crun-1.8.7.tar.xz Normal file

Binary file not shown.

View File

@ -1,16 +1,31 @@
Name: crun
Version: 1.4.5
Release: 1
Version: 1.8.7
Release: 3
Summary: A fast and low-memory footprint OCI Container Runtime fully written in C.
URL: https://github.com/containers/%{name}
Patch1: 0001-CVE-2025-24965.patch
Source0: https://github.com/containers/crun/releases/download/%{version}/%{name}-%{version}.tar.xz
License: GPLv2+ and LGPLv2.1+
BuildRequires: autoconf automake gcc python
BuildRequires: libcap-devel systemd-devel yajl-devel libseccomp-devel libselinux-devel
BuildRequires: libtool make glibc-static protobuf-c-devel
%ifnarch %ix86
BuildRequires: criu-devel >= 3.15
License: GPL-2.0-only
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc
BuildRequires: git-core
BuildRequires: gperf
BuildRequires: libcap-devel
BuildRequires: systemd-devel
BuildRequires: yajl-devel
BuildRequires: libseccomp-devel
BuildRequires: python3-libmount
BuildRequires: libtool
BuildRequires: protobuf-c-devel
%ifnarch riscv64
BuildRequires: criu-devel
Recommends: criu
Recommends: criu-libs
%endif
BuildRequires: python3
Provides: oci-runtime
%description
@ -42,6 +57,25 @@ rm -rf %{buildroot}%{_prefix}/lib*
%{_mandir}/man1/*
%changelog
* Fri Mar 7 2025 zhihang <zhihang161013@outlook.com> - 1.8.7-3
- Fix CVE-2025-24965
* Sun Apr 28 2024 yinsist <jianhui.oerv@isrc.iscas.ac.cn> - 1.8.7-2
- Disable criu dependency for RISC-V as criu does not currently support RISC-V
* Thu Apr 25 2024 lijian <lijian2@kylinos.cn> - 1.8.7-1
- update to 1.8.7
- crun: new command "crun features".
- linux: support io_priority from the OCI specs.
- cgroup: allow setting swap to 0.
- cgroup, systemd: set the memory limit on the system scope.
* Wed Apr 17 2024 huayumeng <huayumeng@kylinos.cn> - 1.8.1-2
- readonlyPaths should inherit flags from parent mount
* Wed May 10 2023 zmr_2020 <zhang_jian7@hoperun.com> - 1.8.1-1
- update to 1.8.1
* Wed Jul 20 2022 fushanqing <fushanqing@kylinos.cn> - 1.4.5-1
- update to 1.4.5