From d1c1d97e6ab85bbe8b5d53d17bda714798ce07f1 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Wed, 21 Sep 2016 06:43:52 +0000 Subject: [PATCH] hyperv/vmbus: Assert that the bufring address is page aligned. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7962 --- sys/dev/hyperv/vmbus/vmbus_chan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/hyperv/vmbus/vmbus_chan.c b/sys/dev/hyperv/vmbus/vmbus_chan.c index c83fd54dc44d..cfc71211782d 100644 --- a/sys/dev/hyperv/vmbus/vmbus_chan.c +++ b/sys/dev/hyperv/vmbus/vmbus_chan.c @@ -250,6 +250,8 @@ vmbus_chan_open_br(struct vmbus_channel *chan, const struct vmbus_chan_br *cbr, ("send bufring size is not multiple page")); KASSERT((rxbr_size & PAGE_MASK) == 0, ("recv bufring size is not multiple page")); + KASSERT((cbr->cbr_paddr & PAGE_MASK) == 0, + ("bufring is not page aligned")); /* * Zero out the TX/RX bufrings, in case that they were used before.