DragonFlyBSD Kernel Audit
DF-2853 / fix.diff
← back to finding ↓ download raw
--- a/sys/kern/subr_rman.c	2026-09-02 11:59:33.961262371 +0000
+++ b-guard/sys/kern/subr_rman.c	2026-09-02 11:59:33.981262121 +0000
@@ -248,6 +248,10 @@
 		rstart = rounddown2(rstart + (1ul << RF_ALIGNMENT(flags)) - 1,
 		    1ul << RF_ALIGNMENT(flags));
 		rend = ulmin(s->r_end, ulmax(start + count - 1, end));
+		if (rstart > rend) {
+			DPRINTF(("aligned start exceeds region end\n"));
+			continue;
+		}
 		DPRINTF(("truncated region: [%#lx, %#lx]; size %#lx (requested %#lx)\n",
 		       rstart, rend, (rend - rstart + 1), count));