NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/58146: msdosfs crash on rename



I propose to commit this and request pullup to 10.
I copied the comment to be in line with genfs_rename.c.

Index: fs/msdosfs/msdosfs_rename.c
===================================================================
RCS file: /cvsroot/src/sys/fs/msdosfs/msdosfs_rename.c,v
retrieving revision 1.3
diff -u -r1.3 msdosfs_rename.c
--- fs/msdosfs/msdosfs_rename.c	23 Oct 2021 16:58:17 -0000	1.3
+++ fs/msdosfs/msdosfs_rename.c	20 May 2024 11:30:26 -0000
@@ -127,7 +127,13 @@
 	KASSERT(tdvp->v_type == VDIR);
 
 	cred = fcnp->cn_cred;
-	KASSERT(tcnp->cn_cred == cred);
+
+	/*
+	 * XXX Want a better equality test.  `tcnp->cn_cred == cred'
+	 * hoses p2k because puffs transmits the creds separately and
+	 * allocates distinct but equivalent structures for them.
+	 */
+	KASSERT(kauth_cred_uidmatch(cred, tcnp->cn_cred));
 
 	/*
 	 * Sanitize our world from the VFS insanity.  Unlock the target


Home | Main Index | Thread Index | Old Index