Repository: microsoft/azurelinux
Pull request #13166: [LOW] Patch ceph for CVE-2020-14378
Author: login: archana25-ms
Labels: name: security
name: Packaging
name: fasttrack/3.0
description: PRs Destined for Azure Linux 3.0
name: CVEFixReadyForMaintainerReview
description: When a CVE fix has been reviewed by release manager and is ready for stable maintainer review
Created: 2025-03-28T07:32:08Z | Merged: 2025-04-21T19:17:35Z

<!--
COMMENT BLOCKS WILL NOT BE INCLUDED IN THE PR.
Feel free to delete sections of the template which do not apply to your PR, or add additional details
-->

###### Merge Checklist  <!-- REQUIRED -->
<!-- You can set them now ([x]) or set them later using the Github UI -->
**All** boxes should be checked before merging the PR *(just tick any boxes which don't apply to this PR)*
- [x] The toolchain has been rebuilt successfully (or no changes were made to it)
- [x] The toolchain/worker package manifests are up-to-date
- [x] Any updated packages successfully build (or no packages were changed)
- [x] Packages depending on static components modified in this PR (Golang, `*-static` subpackages, etc.) have had their `Release` tag incremented.
- [x] Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
- [x] All package sources are available
- [x] cgmanifest files are up-to-date and sorted (`./cgmanifest.json`, `./toolkit/scripts/toolchain/cgmanifest.json`, `.github/workflows/cgmanifest.json`)
- [x] LICENSE-MAP files are up-to-date (`./LICENSES-AND-NOTICES/SPECS/data/licenses.json`, `./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md`, `./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON`)
- [x] All source files have up-to-date hashes in the `*.signatures.json` files
- [x] `sudo make go-tidy-all` and `sudo make go-test-coverage` pass
- [x] Documentation has been updated to match any changes to the build system
- [ ] Ready to merge

---

###### Summary <!-- REQUIRED -->
<!-- Quick explanation of the changes. -->
What does the PR accomplish, why was it needed?
Patch ceph for CVE-2020-14378

###### Change Log  <!-- REQUIRED -->
<!-- Detail the changes made here. -->
<!-- Please list any packages which will be affected by this change, if applicable. -->
<!-- Please list any CVES fixed by this change, if applicable. -->
- SPECS/ceph/CVE-2020-14378.patch
- SPECS/ceph/ceph.spec

###### Does this affect the toolchain?  <!-- REQUIRED -->
<!-- Any packages which are included in the toolchain should be carefully considered. Make sure the toolchain builds with these changes if so. -->
<!-- Update: manifests/package/toolchain_*.txt, pkggen_core_*.txt, update_manifests.sh -->
<!-- To validate: make clean; make workplan REBUILD_TOOLCHAIN=y DISABLE_UPSTREAM_REPOS=y CONFIG_FILE="" ... -->
**NO**

###### Associated issues  <!-- optional -->
<!-- Link to Github issues if possible. -->
<!-- you can use "fixes #xxxx" to auto close an associated issue once the PR is merged -->
- #xxxx

###### Links to CVEs  <!-- optional -->
- https://nvd.nist.gov/vuln/detail/CVE-YYYY-XXXX

###### Test Methodology
<!-- How was this test validated? i.e. local build, pipeline build etc. -->
- Pipeline build id: xxxx



Diff:
diff --git a/SPECS/ceph/CVE-2020-14378.patch b/SPECS/ceph/CVE-2020-14378.patch
new file mode 100644
index 00000000000..05e4529564a
--- /dev/null
+++ b/SPECS/ceph/CVE-2020-14378.patch
@@ -0,0 +1,55 @@
+From a70de0405b30f576c7c947098775b07bcdcbbce2 Mon Sep 17 00:00:00 2001
+From: archana25-ms <v-shettigara@microsoft.com>
+Date: Wed, 26 Mar 2025 07:08:51 +0000
+Subject: [PATCH] Address CVE-2020-14378
+
+Upstream Patch Reference: https://git.dpdk.org/dpdk-stable/commit/?id=7a5af91f8bf46f121cc1a7873045ef37f63d56c2
+
+---
+ src/seastar/dpdk/lib/librte_vhost/vhost_crypto.c | 3 ++-
+ src/spdk/dpdk/lib/librte_vhost/vhost_crypto.c    | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/src/seastar/dpdk/lib/librte_vhost/vhost_crypto.c b/src/seastar/dpdk/lib/librte_vhost/vhost_crypto.c
+index 9d569fcc5..28969297a 100644
+--- a/src/seastar/dpdk/lib/librte_vhost/vhost_crypto.c
++++ b/src/seastar/dpdk/lib/librte_vhost/vhost_crypto.c
+@@ -540,13 +540,14 @@ move_desc(struct vring_desc *head, struct vring_desc **cur_desc,
+ 	int left = size - desc->len;
+ 
+ 	while ((desc->flags & VRING_DESC_F_NEXT) && left > 0) {
+-		(*nb_descs)--;
+ 		if (unlikely(*nb_descs == 0 || desc->next >= vq_size))
+ 			return -1;
+ 
+ 		desc = &head[desc->next];
+ 		rte_prefetch0(&head[desc->next]);
+ 		left -= desc->len;
++		if (left > 0)
++			(*nb_descs)--;
+ 	}
+ 
+ 	if (unlikely(left > 0))
+diff --git a/src/spdk/dpdk/lib/librte_vhost/vhost_crypto.c b/src/spdk/dpdk/lib/librte_vhost/vhost_crypto.c
+index 0f9df4059..86747dd5f 100644
+--- a/src/spdk/dpdk/lib/librte_vhost/vhost_crypto.c
++++ b/src/spdk/dpdk/lib/librte_vhost/vhost_crypto.c
+@@ -530,13 +530,14 @@ move_desc(struct vring_desc *head, struct vring_desc **cur_desc,
+ 	int left = size - desc->len;
+ 
+ 	while ((desc->flags & VRING_DESC_F_NEXT) && left > 0) {
+-		(*nb_descs)--;
+ 		if (unlikely(*nb_descs == 0 || desc->next >= vq_size))
+ 			return -1;
+ 
+ 		desc = &head[desc->next];
+ 		rte_prefetch0(&head[desc->next]);
+ 		left -= desc->len;
++		if (left > 0)
++			(*nb_descs)--;
+ 	}
+ 
+ 	if (unlikely(left > 0))
+-- 
+2.45.3
+
diff --git a/SPECS/ceph/ceph.spec b/SPECS/ceph/ceph.spec
index 127008e36d0..3bbb2947ac1 100644
--- a/SPECS/ceph/ceph.spec
+++ b/SPECS/ceph/ceph.spec
@@ -5,7 +5,7 @@
 Summary:        User space components of the Ceph file system
 Name:           ceph
 Version:        18.2.2
-Release:        7%{?dist}
+Release:        8%{?dist}
 License:        LGPLv2 and LGPLv3 and CC-BY-SA and GPLv2 and Boost and BSD and MIT and Public Domain and GPLv3 and ASL-2.0
 URL:            https://ceph.io/
 Vendor:         Microsoft Corporation
@@ -27,7 +27,7 @@ Patch12:        CVE-2021-24032.patch
 Patch13:        CVE-2020-10724.patch
 Patch14:        CVE-2025-1744.patch
 Patch15:        CVE-2021-28361.patch
-
+Patch16:        CVE-2020-14378.patch
 #
 # Copyright (C) 2004-2019 The Ceph Project Developers. See COPYING file
 # at the top-level directory of this distribution and at
@@ -2018,6 +2018,9 @@ exit 0
 %config %{_sysconfdir}/prometheus/ceph/ceph_default_alerts.yml
 
 %changelog
+* Wed 16 Apr 2025 Archana Shettigar <v-shettigara@microsoft.com> - 18.2.2-8
+- Patch CVE-2020-14378
+
 * Thu Apr 10 2025 Kanishk Bansal <kanbansal@microsoft.com> - 18.2.2-7
 - Patch CVE-2021-28361
 - Explicitly disable seastar to ensure disputed uncompiled CVEs don't get enabled.


Reviews:
user: login: Kanishk-Bansal
body: code changes LGTM, [Buddy Build](https://dev.azure.com/mariner-org/mariner/_build/results?buildId=774004&view=results)

bpftrace & libguestfs are known failures
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-28T13:20:19Z
user: login: 0xba1a
state: APPROVED
author_association: MEMBER
submitted_at: 2025-04-01T10:13:30Z
user: login: Kanishk-Bansal
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-18T19:37:56Z

Review comments:
diff_hunk: @@ -0,0 +1,55 @@
+From a70de0405b30f576c7c947098775b07bcdcbbce2 Mon Sep 17 00:00:00 2001
+From: archana25-ms <v-shettigara@microsoft.com>
+Date: Wed, 26 Mar 2025 07:08:51 +0000
+Subject: [PATCH] Address CVE-2020-14378
+
+Upstream Patch Reference: https://git.dpdk.org/dpdk-stable/commit/?id=7a5af91f8bf46f121cc1a7873045ef37f63d56c2
path: SPECS/ceph/CVE-2020-14378.patch
user: login: 0xba1a
body: Patch applies with a shift.
Same patch applicable to two files of same project in two different directories.
created_at: 2025-04-01T10:09:04Z
author_association: MEMBER
diff_hunk: @@ -26,6 +26,7 @@ Patch11:        CVE-2024-25629.patch
 Patch12:        CVE-2021-24032.patch
 Patch13:        CVE-2020-10724.patch
 Patch14:	CVE-2025-1744.patch
+Patch15:	CVE-2020-14378.patch
path: SPECS/ceph/ceph.spec
user: login: 0xba1a
body: Patch applies cleanly

```
time="2025-03-28T08:31:54Z" level=debug msg="+ /usr/lib/rpm/rpmuncompress /usr/src/azl/SOURCES/CVE-2020-14378.patch"
time="2025-03-28T08:31:54Z" level=debug msg="+ /bin/patch -p1 -s --fuzz=0 --no-backup-if-mismatch -f"
time="2025-03-28T08:31:54Z" level=debug msg="+ RPM_EC=0"
time="2025-03-28T08:31:54Z" level=debug msg="++ jobs -p"
time="2025-03-28T08:31:54Z" level=debug msg="+ exit 0"
```
created_at: 2025-04-01T10:13:23Z
author_association: MEMBER

PR comments:
user: login: Kanishk-Bansal
created_at: 2025-03-28T09:14:55Z
body: /azurepipelines run
author_association: CONTRIBUTOR
user: login: azure-pipelines[bot]
created_at: 2025-03-28T09:15:09Z
body: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
author_association: NONE
user: login: Kanishk-Bansal
created_at: 2025-03-30T09:46:00Z
body: /azurepipelines run
author_association: CONTRIBUTOR
user: login: azure-pipelines[bot]
created_at: 2025-03-30T09:46:12Z
body: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
author_association: NONE
user: login: 0xba1a
created_at: 2025-04-01T10:14:13Z
body: @archana25-ms Please rebase before merging
author_association: MEMBER
user: login: archana25-ms
created_at: 2025-04-01T11:28:12Z
body: > @archana25-ms Please rebase before merging

Rebase Done
author_association: CONTRIBUTOR
user: login: jslobodzian
created_at: 2025-04-16T19:02:02Z
body: @archana25-ms please resolve the merge conflicts
author_association: COLLABORATOR
user: login: archana25-ms
created_at: 2025-04-17T05:49:49Z
body: > @archana25-ms please resolve the merge conflicts

Resolved
author_association: CONTRIBUTOR
user: login: Kanishk-Bansal
created_at: 2025-04-17T19:03:12Z
body: /azurepipelines run
author_association: CONTRIBUTOR
user: login: azure-pipelines[bot]
created_at: 2025-04-17T19:03:24Z
body: <samp>
Azure Pipelines successfully started running 1 pipeline(s).<br>

</samp>
author_association: NONE
user: login: CBL-Mariner-Bot
created_at: 2025-04-21T19:24:23Z
body: Auto cherry-pick results:
- 3.0-dev :white_check_mark: -> https://github.com/microsoft/azurelinux/pull/13511

Auto cherry-pick pipeline run -> https://dev.azure.com/mariner-org/mariner/_build/results?buildId=792470&view=results
author_association: COLLABORATOR