⬢ DragonFlyBSD Kernel Audit
DF-3253 / instrument_df3253.diff
← back to finding ↓ download raw
--- instrument_df3253.diff ---
Guest-side instrumentation for DF-3253 (NEVER applied to the audit sys/ tree):
simulate the cold-disk bread/validation latency window inside hpfs_vget's
post-publish failure paths, so the publish-before-validate handoff window is
10ms instead of sub-microsecond (cache-hot bread).  Real-world analogue:
fnode read from rotating media / stalled device = 5-20ms.

--- a/usr/src/sys/vfs/hpfs/hpfs_vfsops.c
+++ b/usr/src/sys/vfs/hpfs/hpfs_vfsops.c
@@
 	error = bread(hpmp->hpm_devvp, dbtodoff(ino), FNODESIZE, &bp);
 	if (error) {
 		kprintf("hpfs_vget: can't read ino %"PRId64"\n",ino);
+		/* DF3253 instrument: cold-I/O validation window */
+		tsleep(&hp->h_fn, 0, "df3253w", hz / 100);
 		vx_put(vp);
 		return (error);
 	}
@@
 	if (hp->h_fn.fn_magic != FN_MAGIC) {
 		kprintf("hpfs_vget: MAGIC DOESN'T MATCH\n");
+		/* DF3253 instrument: cold-I/O validation window */
+		tsleep(&hp->h_fn, 0, "df3253w", hz / 100);
 		vx_put(vp);
 		return (EINVAL);
 	}