From 013ecf4f81f504c6fc7d1cc8a4d890ae7b197ba1 Mon Sep 17 00:00:00 2001 From: pooka Date: Tue, 6 Jul 2010 12:05:18 +0000 Subject: [PATCH] Make sure that pa_spare is zero-filled and does not contain any garbage which might disrupt future use. --- sys/fs/puffs/puffs_vfsops.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/sys/fs/puffs/puffs_vfsops.c b/sys/fs/puffs/puffs_vfsops.c index 3b54b0dcd5e5..8edf03d0ea4b 100644 --- a/sys/fs/puffs/puffs_vfsops.c +++ b/sys/fs/puffs/puffs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: puffs_vfsops.c,v 1.90 2010/06/24 13:03:10 hannken Exp $ */ +/* $NetBSD: puffs_vfsops.c,v 1.91 2010/07/06 12:05:18 pooka Exp $ */ /* * Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.90 2010/06/24 13:03:10 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.91 2010/07/06 12:05:18 pooka Exp $"); #include #include @@ -129,6 +129,15 @@ puffs_vfsop_mount(struct mount *mp, const char *path, void *data, goto out; } + for (i = 0; i < __arraycount(args->pa_spare); i++) { + if (args->pa_spare[i] != 0) { + printf("puffs_mount: pa_spare[%d] = 0x%x\n", + i, args->pa_spare[i]); + error = EINVAL; + goto out; + } + } + /* use dummy value for passthrough */ if (args->pa_fhflags & PUFFS_FHFLAG_PASSTHROUGH) args->pa_fhsize = sizeof(struct fid);