diff --git a/quota-4.04-sw.patch b/1000-quota-4.04-sw.patch similarity index 100% rename from quota-4.04-sw.patch rename to 1000-quota-4.04-sw.patch diff --git a/quota-master-quotaio_xfs-Fix-memory-leak.patch b/quota-master-quotaio_xfs-Fix-memory-leak.patch new file mode 100644 index 0000000000000000000000000000000000000000..98abac5d7b36b40f3115d70c1945626624d250b7 --- /dev/null +++ b/quota-master-quotaio_xfs-Fix-memory-leak.patch @@ -0,0 +1,30 @@ +From c59b85805ee64c7ee2937b91533eb96f56d87738 Mon Sep 17 00:00:00 2001 +From: Pavel Reichl +Date: Tue, 30 Jul 2024 00:18:13 +0200 +Subject: [PATCH] quotaio_xfs: Fix memory leak + +Error: RESOURCE_LEAK (CWE-772): +quota-4.09/quotaio_xfs.c:162:2: alloc_fn: Storage is returned from allocation function "get_empty_dquot". +quota-4.09/quotaio_xfs.c:162:2: var_assign: Assigning: "dquot" = storage returned from "get_empty_dquot()". +quota-4.09/quotaio_xfs.c:180:4: leaked_storage: Variable "dquot" going out of scope leaks the storage it points to. + +Signed-off-by: Pavel Reichl +--- + quotaio_xfs.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/quotaio_xfs.c b/quotaio_xfs.c +index 2df27b5..5446bc5 100644 +--- a/quotaio_xfs.c ++++ b/quotaio_xfs.c +@@ -174,6 +174,7 @@ static struct dquot *xfs_read_dquot(struct quota_handle *h, qid_t id) + * zeros. Otherwise return failure. + */ + if (errno != ENOENT) { ++ free(dquot); + return NULL; + } + } +-- +2.46.0 + diff --git a/quota.spec b/quota.spec index b70aa364fd1b739e3f678f2531a2ea0493dd858e..4769031ca2652da4e8d06de0eba2a900cfba8582 100644 --- a/quota.spec +++ b/quota.spec @@ -15,7 +15,7 @@ Name: quota Epoch: 1 Version: 4.09 -Release: 2%{anolis_release}%{?dist} +Release: 4%{anolis_release}%{?dist} Summary: System administration tools for monitoring users' disk usage # quota_nld.c, quotaio_xfs.h: GPLv2 # bylabel.c copied from util-linux: GPLv2+ @@ -66,7 +66,8 @@ Patch3: quota-4.10-Add-quotactl_fd-support.patch Patch4: quota-4.10-Enable-support-for-tmpfs-quotas.patch Patch5: quota-4.10-quotaio_xfs-Fix-error-handling-in-xfs_read_dquot.patch Patch6: quota-4.10-quotaio_xfs-Fix-quota-tools-on-XFS.patch -Patch7: quota-4.04-sw.patch +Patch7: quota-master-quotaio_xfs-Fix-memory-leak.patch +Patch1000: 1000-quota-4.04-sw.patch BuildRequires: autoconf BuildRequires: automake @@ -345,9 +346,17 @@ make check %changelog -* Fri Nov 29 2024 wxiat - 1:4.09-2.0.1 +* Wed Dec 03 2025 wxiat - 1:4.09-4.0.1 - add sw patch +* Thu Sep 12 2024 Pavel Reichl - 1:4.09-4 +- Fix patch application +- Related: RHEL-50914 + +* Thu Sep 12 2024 Pavel Reichl - 1:4.09-3 +- Fix memory leak +- Related: RHEL-50914 + * Fri Jul 26 2024 Pavel Reichl - 1:4.09-2 - Fix regression - Related: RHEL-50644