Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
85350c6
Update change logs to sync up with the ones in PMC (#6750)
liunan-ms Nov 15, 2023
f52eea5
kubernetes: fix version subcommand for components (#6722)
mfrw Nov 15, 2023
e47df52
[AUTOPATCHER-CORE] Upgrade vim to 9.0.2068 CVE-2023-46246 (#6758)
CBL-Mariner-Bot Nov 15, 2023
9dc4183
fix tmux crashing bug (#6766)
tobiasb-ms Nov 16, 2023
f11ab51
kernel: nopatch CVE-2023-5178 (#6773)
Redent0r Nov 16, 2023
9ba4e8f
Upgrade valgrind to 3.22.0 (#6777)
snambakam Nov 17, 2023
edbe1a4
Fixed signature checking for local sources to break the build on a mi…
PawelWMS Nov 17, 2023
0a74e85
busybox: Enable SELinux features. (#6772)
pebenito Nov 17, 2023
4413a0d
[AUTO-CHERRYPICK] Make cascanding rebuilds configurable - branch main…
CBL-Mariner-Bot Nov 17, 2023
628bb96
Fix opensc CVE-2023-4535 (#6796)
rikenm1 Nov 18, 2023
5fbff62
add kernel-mos to ccache config (#6807)
anphel31 Nov 20, 2023
931cc78
Print more details on image fetch failures (#6732)
dmcilvaney Nov 20, 2023
8705b5c
Print blocked node summary (#6374)
dmcilvaney Nov 20, 2023
03cb878
Pass toolchain archive to make in pipeline template (#6640)
dmcilvaney Nov 20, 2023
de39340
Print logs on build/test failure (#6768)
neha170 Nov 21, 2023
1f4f655
Update kernel, kernel-hci, kernel-azure BuildRequires to include cpio…
rlmenge Nov 21, 2023
ffbf91e
Update kernel-mshv, kernel-uvm, kernel-uvm-cvm BuildRequires to inclu…
rlmenge Nov 21, 2023
a60f1aa
[AUTO-CHERRYPICK] Patch package frr to fix CVE-2023-47234 and CVE-202…
CBL-Mariner-Bot Nov 21, 2023
61704d6
[AUTOPATCHER-kernel] Kernel upgrade to version 5.15.138.1 - branch ma…
CBL-Mariner-Bot Nov 21, 2023
0ae5d72
Add ExtractNameFromRPMPath() to rpm.go (#6370)
dmcilvaney Nov 21, 2023
06e3445
[AUTO-CHERRYPICK] Added patch for CVE-2023-46136 to python-werkzeug -…
CBL-Mariner-Bot Nov 22, 2023
f0740a1
containerized-build: Add downloader to list of tools to build (#6830)
neha170 Nov 22, 2023
cb07ddc
msft-golang: upgrade 1.20.11 (#6831)
anphel31 Nov 22, 2023
40e7cbc
Add linuxptp v3.1.1 with High-Availability patches (#6404)
harshitgupta1337 Nov 23, 2023
7f29342
Add package double-conversion to SPECS (#6825)
sindhu-karri Nov 27, 2023
27f0b00
Move package glog from Extended to Core (#6826)
sindhu-karri Nov 27, 2023
957335b
[AUTO-CHERRYPICK] Patched HIGH CVE-2022-38725 for syslog-ng - branch …
CBL-Mariner-Bot Nov 27, 2023
5a2713c
syslog-ng: Comment out check section (#6847)
Redent0r Nov 27, 2023
01e2d39
[AUTO-CHERRYPICK] Fix qemu CVE-2023-3354 - branch main (#6851)
CBL-Mariner-Bot Nov 27, 2023
3e00ed1
Nopatch kernel CVE-2023-39198 (#6834)
rlmenge Nov 27, 2023
a152d16
Toolkit: Cleanup and improve logs. (#6848)
cwize1 Nov 28, 2023
ff7d597
Enable CONFIG_ARM_SMMU and CONFIG_ARM_SMMU_V3 in aarch64. (#6829)
ddaney-fungible Nov 28, 2023
ef7b051
[AUTOPATCHER-CORE] Upgrade vim to 9.0.2112 CVEs (#6852)
CBL-Mariner-Bot Nov 28, 2023
37d627f
[AUTOPATCHER-CORE] Upgrade mysql to 8.0.35 none (#6856)
CBL-Mariner-Bot Nov 28, 2023
b664635
Enable CONFIG_BPF_LSM (#6846)
trungams Nov 28, 2023
6c7594b
Added package `python3-junit-xml`. (#6812)
PawelWMS Nov 28, 2023
81e0c43
Add additional functions to pkggraph.go (#6368)
dmcilvaney Nov 28, 2023
8c86df1
Joslobo/update docs from 2.0 (#6862)
jslobodzian Nov 29, 2023
e48b93d
Image Customizer: Implement fallback partition customization. (#6747)
cwize1 Nov 29, 2023
35a3498
Adding CUSE module for rshim interface support (#6853)
jcamposeco Nov 29, 2023
c9ceb2b
[AUTO-CHERRYPICK] [AUTOPATCHER-CORE] Upgrade mysql to 8.0.35 address …
CBL-Mariner-Bot Nov 30, 2023
420331e
Prepare December 2023 Release (#6869)
CBL-Mariner-Bot Nov 30, 2023
4341e43
Upgrade Blobfuse2 to 2.1.2 (#6803)
anu-avocado Nov 30, 2023
15d0dfe
Print chroot-tools progress (#6053)
dmcilvaney Nov 30, 2023
631a180
mariner-repos: add cloud native repo (#6864)
anphel31 Nov 30, 2023
2b1b635
Image Customizer: Add Initial MIC release file (#6594)
elainezhao1 Nov 30, 2023
4e8b6fc
Merge branch 'main' into joslobo/merge-from-main-dec2023
jslobodzian Nov 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .pipelines/templates/PackageBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ parameters:
- "false"
- "true"

- name: maxCascadingRebuilds
type: string
default: ""

- name: outputArtifactsFolder
type: string
default: "$(Build.ArtifactStagingDirectory)"
Expand Down Expand Up @@ -146,6 +150,7 @@ steps:
echo "ERROR: toolchain archive not found!" >&2
exit 1
fi
echo "##vso[task.setvariable variable=toolchainArchive]$toolchain_archive"

sudo make -C "${{ parameters.buildRepoRoot }}/toolkit" toolchain TOOLCHAIN_ARCHIVE="$toolchain_archive"
displayName: "Populate toolchain"
Expand Down Expand Up @@ -192,18 +197,24 @@ steps:
use_ccache_arg="USE_CCACHE=n"
fi

if [[ -n "${{ parameters.customToolchainArtifactName }}" ]]; then
toolchain_archive_arg="TOOLCHAIN_ARCHIVE=$(toolchainArchive)"
fi

sudo make -C "${{ parameters.buildRepoRoot }}/toolkit" build-packages -j$(nproc) \
CONCURRENT_PACKAGE_BUILDS=${{ parameters.concurrentPackageBuilds }} \
CONFIG_FILE="" \
MAX_CASCADING_REBUILDS="${{ parameters.maxCascadingRebuilds }}" \
MAX_CPU="${{ parameters.maxCPU }}" \
REBUILD_TOOLS=y \
REPO_LIST="${{ parameters.extraPackageRepos }}" \
SPECS_DIR="${{ parameters.buildRepoRoot }}/${{ parameters.specsFolderPath }}" \
SRPM_PACK_LIST="${{ parameters.srpmPackList }}" \
TEST_RERUN_LIST="${{ parameters.testRerunList }}" \
$delta_fetch_arg \
$quick_rebuild_packages_arg \
$run_check_arg \
TEST_RERUN_LIST="${{ parameters.testRerunList }}" \
$toolchain_archive_arg \
$use_ccache_arg
displayName: "Build packages"

Expand Down
2 changes: 1 addition & 1 deletion SPECS-EXTENDED/buildah/buildah.spec
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ cp imgtype %{buildroot}/%{_bindir}/%{name}-imgtype
- Bump release to rebuild against glibc 2.35-6

* Mon Oct 16 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 1.18.0-20
- Bump release to rebuild with go 1.20.10
- Bump release to rebuild with go 1.20.9

* Tue Oct 10 2023 Dan Streetman <ddstreet@ieee.org> - 1.18.0-19
- Bump release to rebuild with updated version of Go.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ install -p plugins/ipam/dhcp/systemd/cni-dhcp.socket %{buildroot}%{_unitdir}

%changelog
* Mon Oct 16 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 1.1.1-13
- Bump release to rebuild with go 1.20.10
- Bump release to rebuild with go 1.20.9

* Tue Oct 10 2023 Dan Streetman <ddstreet@ieee.org> - 1.1.1-12
- Bump release to rebuild with updated version of Go.
Expand Down
2 changes: 1 addition & 1 deletion SPECS-EXTENDED/delve/delve.spec
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ done

%changelog
* Mon Oct 16 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 1.5.0-16
- Bump release to rebuild with go 1.20.10
- Bump release to rebuild with go 1.20.9

* Tue Oct 10 2023 Dan Streetman <ddstreet@ieee.org> - 1.5.0-15
- Bump release to rebuild with updated version of Go.
Expand Down
11 changes: 0 additions & 11 deletions SPECS-EXTENDED/linuxptp/linuxptp.signatures.json

This file was deleted.

2 changes: 1 addition & 1 deletion SPECS-EXTENDED/podman/podman.spec
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ cp -pav test/system %{buildroot}/%{_datadir}/%{name}/test/
- Bump release to rebuild against glibc 2.35-6

* Mon Oct 16 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 4.1.1-17
- Bump release to rebuild with go 1.20.10
- Bump release to rebuild with go 1.20.9

* Tue Oct 10 2023 Dan Streetman <ddstreet@ieee.org> - 4.1.1-16
- Bump release to rebuild with updated version of Go.
Expand Down
2 changes: 1 addition & 1 deletion SPECS-EXTENDED/umoci/umoci.spec
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ go test -mod=vendor

%changelog
* Mon Oct 16 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 0.4.7-13
- Bump release to rebuild with go 1.20.10
- Bump release to rebuild with go 1.20.9

* Tue Oct 10 2023 Dan Streetman <ddstreet@ieee.org> - 0.4.7-12
- Bump release to rebuild with updated version of Go.
Expand Down
8 changes: 7 additions & 1 deletion SPECS-SIGNED/kernel-azure-signed/kernel-azure-signed.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
%define uname_r %{version}-%{release}
Summary: Signed Linux Kernel for Azure
Name: kernel-azure-signed-%{buildarch}
Version: 5.15.137.1
Version: 5.15.138.1
Release: 1%{?dist}
License: GPLv2
Vendor: Microsoft Corporation
Expand Down Expand Up @@ -153,6 +153,12 @@ ln -sf linux-%{uname_r}.cfg /boot/mariner.cfg
%exclude /module_info.ld

%changelog
* Tue Nov 21 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 5.15.138.1-1
- Auto-upgrade to 5.15.138.1

* Mon Nov 20 2023 Rachel Menge <rachelmenge@microsoft.com> - 5.15.137.1-2
- Bump release to match kernel

* Mon Nov 06 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 5.15.137.1-1
- Auto-upgrade to 5.15.137.1

Expand Down
8 changes: 7 additions & 1 deletion SPECS-SIGNED/kernel-hci-signed/kernel-hci-signed.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%define uname_r %{version}-%{release}
Summary: Signed Linux Kernel for HCI
Name: kernel-hci-signed-%{buildarch}
Version: 5.15.137.1
Version: 5.15.138.1
Release: 1%{?dist}
License: GPLv2
Vendor: Microsoft Corporation
Expand Down Expand Up @@ -149,6 +149,12 @@ ln -sf linux-%{uname_r}.cfg /boot/mariner.cfg
%exclude /module_info.ld

%changelog
* Tue Nov 21 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 5.15.138.1-1
- Auto-upgrade to 5.15.138.1

* Mon Nov 20 2023 Rachel Menge <rachelmenge@microsoft.com> - 5.15.137.1-2
- Bump release to match kernel

* Mon Nov 06 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 5.15.137.1-1
- Auto-upgrade to 5.15.137.1

Expand Down
19 changes: 17 additions & 2 deletions SPECS-SIGNED/kernel-signed/kernel-signed.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
%define uname_r %{version}-%{release}
Summary: Signed Linux Kernel for %{buildarch} systems
Name: kernel-signed-%{buildarch}
Version: 5.15.137.1
Release: 1%{?dist}
Version: 5.15.138.1
Release: 4%{?dist}
License: GPLv2
Vendor: Microsoft Corporation
Distribution: Mariner
Expand Down Expand Up @@ -153,6 +153,21 @@ ln -sf linux-%{uname_r}.cfg /boot/mariner.cfg
%exclude /module_info.ld

%changelog
* Tue Nov 28 2023 Juan Camposeco <juanarturoc@microsoft.com> - 5.15.138.1-4
- Bump release to match kernel

* Tue Nov 28 2023 Thien Trung Vuong <tvuong@microsoft.com> - 5.15.138.1-3
- Bump release to match kernel

* Wed Nov 22 2023 David Daney <daviddaney@microsoft.com> - 5.15.138.1-2
- Bump release to match kernel

* Tue Nov 21 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 5.15.138.1-1
- Auto-upgrade to 5.15.138.1

* Mon Nov 20 2023 Rachel Menge <rachelmenge@microsoft.com> - 5.15.137.1-2
- Bump release to match kernel

* Mon Nov 06 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 5.15.137.1-1
- Auto-upgrade to 5.15.137.1

Expand Down
2 changes: 1 addition & 1 deletion SPECS/KeysInUse-OpenSSL/KeysInUse-OpenSSL.spec
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fi

%changelog
* Mon Oct 16 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 0.3.4-3
- Bump release to rebuild with go 1.20.10
- Bump release to rebuild with go 1.20.9

* Tue Oct 10 2023 Dan Streetman <ddstreet@ieee.org> - 0.3.4-2
- Bump release to rebuild with updated version of Go.
Expand Down
2 changes: 1 addition & 1 deletion SPECS/LICENSES-AND-NOTICES/LICENSES-MAP.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions SPECS/LICENSES-AND-NOTICES/data/licenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
"dogtail",
"dos2unix",
"dotconf",
"double-conversion",
"dovecot",
"dpdk",
"dpkg",
Expand Down Expand Up @@ -1679,6 +1680,7 @@
"python-isodate",
"python-isort",
"python-itsdangerous",
"python-junit-xml",
"python-justbases",
"python-justbytes",
"python-jwcrypto",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ cp appgw-ingress %{buildroot}%{_bindir}/

%changelog
* Mon Oct 16 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 1.4.0-16
- Bump release to rebuild with go 1.20.10
- Bump release to rebuild with go 1.20.9

* Tue Oct 10 2023 Dan Streetman <ddstreet@ieee.org> - 1.4.0-15
- Bump release to rebuild with updated version of Go.
Expand Down
2 changes: 1 addition & 1 deletion SPECS/azcopy/azcopy.spec
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ go test -mod=vendor

%changelog
* Mon Oct 16 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 10.15.0-14
- Bump release to rebuild with go 1.20.10
- Bump release to rebuild with go 1.20.9

* Tue Oct 10 2023 Dan Streetman <ddstreet@ieee.org> - 10.15.0-13
- Bump release to rebuild with updated version of Go.
Expand Down
2 changes: 1 addition & 1 deletion SPECS/blobfuse/blobfuse.spec
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ install -p -m 755 build/blobfuse %{buildroot}%{_bindir}/

%changelog
* Mon Oct 16 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 1.4.5-13
- Bump release to rebuild with go 1.20.10
- Bump release to rebuild with go 1.20.9

* Tue Oct 10 2023 Dan Streetman <ddstreet@ieee.org> - 1.4.5-12
- Bump release to rebuild with updated version of Go.
Expand Down
4 changes: 2 additions & 2 deletions SPECS/blobfuse2/blobfuse2.signatures.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Signatures": {
"blobfuse2-2.1.1.tar.gz": "6bbed0d7db05ecfe7b7e12b5c4506dde1e2ef018ce1ac6fe6c8b7d697af24968",
"blobfuse2-2.1.1-vendor.tar.gz": "85cbf93aacaa63e583dd9a72f4823f9c993449d5f2ab2332d8b97b4bf91e7da0"
"blobfuse2-2.1.2.tar.gz": "4605015d99c7ffac37ae464aa1d23c11ecd6218122acb06f1c46ac7bdced908e",
"blobfuse2-2.1.2-vendor.tar.gz": "84229241b170316438aa408ae38216e01c54fffdbe50b59ae3b5ab1b4f7122c6"
}
}
7 changes: 5 additions & 2 deletions SPECS/blobfuse2/blobfuse2.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%global debug_package %{nil}

%define our_gopath %{_topdir}/.gopath
%define blobfuse2_version 2.1.1
%define blobfuse2_version 2.1.2
%define blobfuse2_health_monitor bfusemon

Summary: FUSE adapter - Azure Storage
Expand Down Expand Up @@ -80,11 +80,14 @@ install -D -m 0644 ./setup/blobfuse2-logrotate %{buildroot}%{_sysconfdir}/logrot
%{_sysconfdir}/logrotate.d/blobfuse2

%changelog
* Fri Nov 17 2023 Anubhuti Shruti <ashruti@microsoft.com> - 2.1.2-1
- Bump version to 2.1.2

* Thu Nov 02 2023 Sourav Gupta <souravgupta@microsoft.com> - 2.1.1-1
- Bump version to 2.1.1

* Mon Oct 16 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 2.1.0-3
- Bump release to rebuild with go 1.20.10
- Bump release to rebuild with go 1.20.9

* Tue Oct 10 2023 Dan Streetman <ddstreet@ieee.org> - 2.1.0-2
- Bump release to rebuild with updated version of Go.
Expand Down
4 changes: 2 additions & 2 deletions SPECS/busybox/busybox-static.config
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ CONFIG_FEATURE_SUID_CONFIG=y
CONFIG_FEATURE_SUID_CONFIG_QUIET=y
# CONFIG_FEATURE_PREFER_APPLETS is not set
CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
# CONFIG_SELINUX is not set
CONFIG_SELINUX=y
# CONFIG_FEATURE_CLEAN_UP is not set
CONFIG_PLATFORM_LINUX=y
#
Expand Down Expand Up @@ -176,7 +176,7 @@ CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
CONFIG_FEATURE_TAR_TO_COMMAND=y
CONFIG_FEATURE_TAR_UNAME_GNAME=y
CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y
# CONFIG_FEATURE_TAR_SELINUX is not set
CONFIG_FEATURE_TAR_SELINUX=y
CONFIG_UNZIP=y
CONFIG_FEATURE_UNZIP_CDF=y
CONFIG_FEATURE_UNZIP_BZIP2=y
Expand Down
2 changes: 1 addition & 1 deletion SPECS/busybox/busybox.signatures.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"Signatures": {
"busybox-1.35.0.tar.bz2": "faeeb244c35a348a334f4a59e44626ee870fb07b6884d68c10ae8bc19f83a694",
"busybox-petitboot.config": "28a4006863e0125bb564159c120067cb83b52ee0a829579cd399274cc78a10be",
"busybox-static.config": "6f2f534548da57df8b1f5fd4dfe6ceece0f1b97bf7d0baa4c484ac9850cf8e37"
"busybox-static.config": "e97bc24c897e41e5a6fc6b54955b20e3c49ea5828f9ecba6ba520f8291470e58"
}
}
8 changes: 7 additions & 1 deletion SPECS/busybox/busybox.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Summary: Statically linked binary providing simplified versions of system commands
Name: busybox
Version: 1.35.0
Release: 8%{?dist}
Release: 9%{?dist}
License: GPLv2
Vendor: Microsoft Corporation
Distribution: Mariner
Expand All @@ -15,6 +15,8 @@ Patch2: awk-input-numbers-are-never-octal-or-hex-only-progra.patch
Patch3: CVE-2022-30065.patch
Patch4: ash-fix-use-after-free-in-pattern-substituon-code.patch
Patch5: ash-fix-use-after-free-in-bash-pattern-substitution.patch
Patch6: selinux-copy-file.patch
Patch7: selinux-cp-a.patch
BuildRequires: gcc
BuildRequires: glibc-static >= 2.35-6%{?dist}
BuildRequires: libselinux-devel >= 1.27.7-2
Expand Down Expand Up @@ -94,6 +96,10 @@ install -m 644 docs/busybox.petitboot.1 %{buildroot}/%{_mandir}/man1/busybox.pet
%{_mandir}/man1/busybox.petitboot.1.gz

%changelog
* Thu Nov 16 2023 Chris PeBenito <chpebeni@microsoft.com> - 1.35.0-9
- Enable SELinux features.
- Improve SELinux behavior for copy funtions.

* Wed Oct 04 2023 Minghe Ren <mingheren@microsoft.com> - 1.35.0-8
- Bump release to rebuild against glibc 2.35-6

Expand Down
50 changes: 50 additions & 0 deletions SPECS/busybox/selinux-copy-file.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
From 23b2d8b498939723413a60adc6b29e37ec46b91e Mon Sep 17 00:00:00 2001
From: Chris PeBenito <chpebeni@linux.microsoft.com>
Date: Wed, 25 Mar 2020 16:43:17 -0400
Subject: copy_file(): Revise completion of SELinux security context
preserve/set.

The existing setfscreatecon() at the beginning of copy_file() is the secure
method for setting the context of new files, but it doesn't apply to
existing files. Change the setfilecon() to only run on preexisting files.

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>

diff -ur busybox-1.35.0.orig/libbb/copy_file.c busybox-1.35.0/libbb/copy_file.c
--- busybox-1.35.0.orig/libbb/copy_file.c 2021-12-26 16:53:20.000000000 +0000
+++ busybox-1.35.0/libbb/copy_file.c 2023-08-16 22:04:45.557799523 +0000
@@ -327,19 +327,22 @@
if ((flags & (FILEUTILS_PRESERVE_SECURITY_CONTEXT|FILEUTILS_SET_SECURITY_CONTEXT))
&& is_selinux_enabled() > 0
) {
- security_context_t con;
- if (getfscreatecon(&con) == -1) {
+ /* Failure to preserve the security context isn't fatal here since
+ * the copy has been done at this point. */
+ security_context_t con = NULL;
+ if (getfscreatecon(&con) < 0)
bb_simple_perror_msg("getfscreatecon");
- return -1;
- }
- if (con) {
- if (setfilecon(dest, con) == -1) {
- bb_perror_msg("setfilecon:%s,%s", dest, con);
- freecon(con);
- return -1;
- }
- freecon(con);
- }
+
+ if (setfscreatecon(NULL) < 0)
+ bb_perror_msg("can't reset fscreate");
+
+ /* setfscreatecon() only works when a file is created. If dest
+ * preexisted, use setfilecon instead */
+ if (con && dest_exists)
+ if (fsetfilecon(dst_fd, con) < 0)
+ bb_perror_msg("fsetfilecon:%s,%s", dest, con);
+
+ freecon(con);
}
#endif
#if ENABLE_FEATURE_CP_REFLINK
Loading