Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/miscfs/procfs Add missing permission check



details:   https://anonhg.NetBSD.org/src/rev/beecfb381eaf
branches:  trunk
changeset: 366820:beecfb381eaf
user:      shm <shm%NetBSD.org@localhost>
date:      Fri Jun 17 14:30:37 2022 +0000

description:
Add missing permission check

diffstat:

 sys/miscfs/procfs/procfs_vnops.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r daae257f3d38 -r beecfb381eaf sys/miscfs/procfs/procfs_vnops.c
--- a/sys/miscfs/procfs/procfs_vnops.c  Fri Jun 17 14:08:54 2022 +0000
+++ b/sys/miscfs/procfs/procfs_vnops.c  Fri Jun 17 14:30:37 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: procfs_vnops.c,v 1.228 2022/03/27 17:10:56 christos Exp $      */
+/*     $NetBSD: procfs_vnops.c,v 1.229 2022/06/17 14:30:37 shm Exp $   */
 
 /*-
  * Copyright (c) 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc.
@@ -105,7 +105,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.228 2022/03/27 17:10:56 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_vnops.c,v 1.229 2022/06/17 14:30:37 shm Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -976,6 +976,9 @@
 
        *vpp = NULL;
 
+       if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred)) != 0)
+               return (error);
+
        if (cnp->cn_nameiop == DELETE || cnp->cn_nameiop == RENAME)
                return (EROFS);
 



Home | Main Index | Thread Index | Old Index