git: d6f99f67507d - stable/14 - swapoff: don't leak vnode pointer to device
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 20 Nov 2026 10:26:11 UTC
The branch stable/14 has been updated by brooks:
URL: https://cgit.FreeBSD.org/src/commit/?id=d6f99f67507dc012806d3404250bd00e559b98c9
commit d6f99f67507dc012806d3404250bd00e559b98c9
Author: Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2026-11-13 10:06:53 +0000
Commit: Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2026-11-20 10:25:42 +0000
swapoff: don't leak vnode pointer to device
After looking up the device path, we compare the vnode to the vnode of
each swap device. Prior to this change we leaked a vnode reference to
the device we're trying to remove from the swap pool.
Effort: CHERI upstreaming
Reviewed by: kib, markj
Reported by: llm-postcr
MFC after: 3 days
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D61464
(cherry picked from commit 9506d8e0b1788068cbd4c2cbc984cb6ee0dcb0ab)
---
sys/vm/swap_pager.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 5a01a5075f52..18eb251070d8 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -2504,6 +2504,7 @@ kern_swapoff(struct thread *td, const char *name, enum uio_seg name_seg,
break;
}
mtx_unlock(&sw_dev_mtx);
+ vrele(vp);
if (sp == NULL) {
error = EINVAL;
goto done;