Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/xen/xen KASSERT() that requested I/O size is <= XBD...



details:   https://anonhg.NetBSD.org/src/rev/da0db2c12c21
branches:  trunk
changeset: 930768:da0db2c12c21
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Mon Apr 13 20:09:13 2020 +0000

description:
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

diffstat:

 sys/arch/xen/xen/xbd_xenbus.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r fe33ed9d15ec -r da0db2c12c21 sys/arch/xen/xen/xbd_xenbus.c
--- a/sys/arch/xen/xen/xbd_xenbus.c     Mon Apr 13 20:02:27 2020 +0000
+++ b/sys/arch/xen/xen/xbd_xenbus.c     Mon Apr 13 20:09:13 2020 +0000
@@ -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 @@
        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) {



Home | Main Index | Thread Index | Old Index