From fd0be988cba4c3206bbc13c61342880048d68d07 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Sat, 18 May 2019 14:19:23 +0000 Subject: [PATCH] Update the DIAGNOSTIC-only vmem_check_sanity() after r347949. Cursor tags are special and shouldn't be subject to the existing checks. Reported by: kib, David Wolfskill MFC with: r347949 --- sys/kern/subr_vmem.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/kern/subr_vmem.c b/sys/kern/subr_vmem.c index 3a7f4f9c8d31..0c8421d9d824 100644 --- a/sys/kern/subr_vmem.c +++ b/sys/kern/subr_vmem.c @@ -1738,10 +1738,20 @@ vmem_check_sanity(vmem_t *vm) } } TAILQ_FOREACH(bt, &vm->vm_seglist, bt_seglist) { + if (bt->bt_type == BT_TYPE_CURSOR) { + if (bt->bt_start != 0 || bt->bt_size != 0) { + printf("corrupted cursor\n"); + return false; + } + continue; + } TAILQ_FOREACH(bt2, &vm->vm_seglist, bt_seglist) { if (bt == bt2) { continue; } + if (bt2->bt_type == BT_TYPE_CURSOR) { + continue; + } if (BT_ISSPAN_P(bt) != BT_ISSPAN_P(bt2)) { continue; }