From 0d5ace558d75572766256c180e611c71f223b837 Mon Sep 17 00:00:00 2001 From: christos Date: Thu, 21 Jul 2016 18:21:27 +0000 Subject: [PATCH] replace variable stack declaration with a large enough one and KASSERT. --- sys/fs/puffs/puffs_vnops.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/fs/puffs/puffs_vnops.c b/sys/fs/puffs/puffs_vnops.c index fab72c5be77e..447f83b523da 100644 --- a/sys/fs/puffs/puffs_vnops.c +++ b/sys/fs/puffs/puffs_vnops.c @@ -1,4 +1,4 @@ -/* $NetBSD: puffs_vnops.c,v 1.204 2016/07/07 06:55:42 msaitoh Exp $ */ +/* $NetBSD: puffs_vnops.c,v 1.205 2016/07/21 18:21:27 christos Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.204 2016/07/07 06:55:42 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.205 2016/07/21 18:21:27 christos Exp $"); #include #include @@ -1147,7 +1147,7 @@ puffs_vnop_getattr(void *v) static void zerofill_lastpage(struct vnode *vp, voff_t off) { - char zbuf[PAGE_SIZE]; + char zbuf[16384]; struct iovec iov; struct uio uio; vsize_t len; @@ -1160,6 +1160,7 @@ zerofill_lastpage(struct vnode *vp, voff_t off) return; len = round_page(off) - off; + KASSERT(len < sizeof(zbuf)); memset(zbuf, 0, len); iov.iov_base = zbuf;