Index: head/sys/geom/geom_ctl.c =================================================================== --- head/sys/geom/geom_ctl.c +++ head/sys/geom/geom_ctl.c @@ -139,6 +139,12 @@ char *p; u_int i; + if (req->narg > 2048) { + gctl_error(req, "too many arguments"); + req->arg = NULL; + return; + } + ap = geom_alloc_copyin(req, req->arg, req->narg * sizeof(*ap)); if (ap == NULL) { gctl_error(req, "bad control request");