Module Name:    src
Committed By:   jdolecek
Date:           Mon Apr 13 20:09:13 UTC 2020

Modified Files:
        src/sys/arch/xen/xen: xbd_xenbus.c

Log Message:
KASSERT() that requested I/O size is <= XBD_MAX_XFER - this can happen
e.g. with custom DomU kernel which doesn't have the value for MAXPHYS
reduced to 32k like the XEN3_DOMU config


To generate a diff of this commit:
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/xen/xen/xbd_xenbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.106 src/sys/arch/xen/xen/xbd_xenbus.c:1.107
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.106	Mon Apr 13 16:29:59 2020
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Mon Apr 13 20:09:13 2020
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbd_xenbus.c,v 1.106 2020/04/13 16:29:59 jdolecek Exp $      */
+/*      $NetBSD: xbd_xenbus.c,v 1.107 2020/04/13 20:09:13 jdolecek Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.106 2020/04/13 16:29:59 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbd_xenbus.c,v 1.107 2020/04/13 20:09:13 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -965,6 +965,8 @@ xbd_diskstart(device_t self, struct buf 
 	DPRINTF(("xbd_diskstart(%p): b_bcount = %ld\n",
 	    bp, (long)bp->b_bcount));
 
+	KASSERT(bp->b_bcount <= XBD_MAX_XFER);
+
 	mutex_enter(&sc->sc_lock);
 
 	if (sc->sc_shutdown != BLKIF_SHUTDOWN_RUN) {

Reply via email to