From 77ad037f655f6abb576b1758f10b8096a7f29d57 Mon Sep 17 00:00:00 2001 From: tedu Date: Mon, 11 Jul 2016 22:36:25 +0000 Subject: [PATCH] don't allow mounting with noval owner. panics later. reported by Tim Newsham at NCC. ok millert natano --- sys/tmpfs/tmpfs_vfsops.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/tmpfs/tmpfs_vfsops.c b/sys/tmpfs/tmpfs_vfsops.c index b0f0e53d799..ff49be01dd8 100644 --- a/sys/tmpfs/tmpfs_vfsops.c +++ b/sys/tmpfs/tmpfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tmpfs_vfsops.c,v 1.8 2016/01/13 13:01:40 gsoares Exp $ */ +/* $OpenBSD: tmpfs_vfsops.c,v 1.9 2016/07/11 22:36:25 tedu Exp $ */ /* $NetBSD: tmpfs_vfsops.c,v 1.52 2011/09/27 01:10:43 christos Exp $ */ /* @@ -125,6 +125,9 @@ tmpfs_mount(struct mount *mp, const char *path, void *data, error = copyin(data, &args, sizeof(struct tmpfs_args)); if (error) return error; + if (args.ta_root_uid == VNOVAL || args.ta_root_gid == VNOVAL || + args.ta_root_mode == VNOVAL) + return EINVAL; /* Get the memory usage limit for this file-system. */ if (args.ta_size_max < PAGE_SIZE) { -- 2.20.1