From 4c6398a93d72d2275bf02673a269bb25c01421eb Mon Sep 17 00:00:00 2001 From: hannken Date: Fri, 8 Jul 2022 07:44:17 +0000 Subject: [PATCH] Make dead vfs ops "vfs_statvfs" and "vfs_vptofh" return EOPNOTSUPP. Both operations may originate from (possible dead) vnodes. Reported-by: syzbot+eceb203d44457742be3b@syzkaller.appspotmail.com --- sys/miscfs/deadfs/dead_vfsops.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/miscfs/deadfs/dead_vfsops.c b/sys/miscfs/deadfs/dead_vfsops.c index 23085b008f29..d25003cc469f 100644 --- a/sys/miscfs/deadfs/dead_vfsops.c +++ b/sys/miscfs/deadfs/dead_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: dead_vfsops.c,v 1.11 2022/03/19 13:53:32 hannken Exp $ */ +/* $NetBSD: dead_vfsops.c,v 1.12 2022/07/08 07:44:17 hannken Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dead_vfsops.c,v 1.11 2022/03/19 13:53:32 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dead_vfsops.c,v 1.12 2022/07/08 07:44:17 hannken Exp $"); #include #include @@ -60,13 +60,13 @@ struct vfsops dead_vfsops = { .vfs_unmount = (void *)dead_panic, .vfs_root = (void *)dead_panic, .vfs_quotactl = (void *)dead_panic, - .vfs_statvfs = (void *)dead_panic, + .vfs_statvfs = (void *)eopnotsupp, .vfs_sync = (void *)dead_panic, .vfs_vget = (void *)dead_panic, .vfs_loadvnode = (void *)dead_panic, .vfs_newvnode = dead_newvnode, .vfs_fhtovp = (void *)dead_panic, - .vfs_vptofh = (void *)dead_panic, + .vfs_vptofh = (void *)eopnotsupp, .vfs_init = (void *)dead_panic, .vfs_reinit = (void *)dead_panic, .vfs_done = (void *)dead_panic,