shithub: gefs

Download patch

ref: b604e0abe047f5e64615fb405c1d74376fc1681a
parent: 340fc77d5f6859c624d8a58bbd79150d3ba74217
author: Ori Bernstein <ori@eigenstate.org>
date: Tue Nov 7 19:00:21 EST 2023

fs: increment refcount of dent before sending it to sweep proc

otherwise, we get a use after free, oops.

--- a/fs.c
+++ b/fs.c
@@ -1243,6 +1243,7 @@
 					rerror(m, Enomem);
 					goto Out;
 				}
+				aincl(&de->ref, 1);
 				aincl(&f->mnt->ref, 1);
 				(*ao)->op = AOclear;
 				(*ao)->mnt = f->mnt;