diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index b8291ae7733..f59b73f9e7e 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.450 2024/10/28 10:18:03 mvs Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.451 2024/10/31 10:06:51 mvs Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -262,6 +262,7 @@ sys_sysctl(struct proc *p, void *v, register_t *retval) fn = net_sysctl; break; case CTL_FS: + dolock = 0; fn = fs_sysctl; break; case CTL_VFS: diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index a7554d54caf..c45880c43f6 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.324 2024/10/18 05:52:32 miod Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.325 2024/10/31 10:06:51 mvs Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -72,6 +72,11 @@ #include "softraid.h" +/* + * Locks used to protect data: + * a atomic + */ + void sr_quiesce(void); enum vtype iftovt_tab[16] = { @@ -84,8 +89,8 @@ int vttoif_tab[9] = { S_IFSOCK, S_IFIFO, S_IFMT, }; -int prtactive = 0; /* 1 => print out reclaim of active vnodes */ -int suid_clear = 1; /* 1 => clear SUID / SGID on owner change */ +int prtactive = 0; /* 1 => print out reclaim of active vnodes */ +int suid_clear = 1; /* [a] 1 => clear SUID / SGID on owner change */ /* * Insq/Remq for the vnode usage lists. diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 33dab14f783..c59f16c91e7 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.368 2024/09/01 23:26:10 deraadt Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.369 2024/10/31 10:06:51 mvs Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -2470,7 +2470,7 @@ dofchownat(struct proc *p, int fd, const char *path, uid_t uid, gid_t gid, goto out; if ((uid != -1 || gid != -1) && !vnoperm(vp) && - (suser(p) || suid_clear)) { + (suser(p) || atomic_load_int(&suid_clear))) { error = VOP_GETATTR(vp, &vattr, p->p_ucred, p); if (error) goto out; @@ -2523,7 +2523,7 @@ sys_lchown(struct proc *p, void *v, register_t *retval) goto out; if ((uid != -1 || gid != -1) && !vnoperm(vp) && - (suser(p) || suid_clear)) { + (suser(p) || atomic_load_int(&suid_clear))) { error = VOP_GETATTR(vp, &vattr, p->p_ucred, p); if (error) goto out; @@ -2573,7 +2573,7 @@ sys_fchown(struct proc *p, void *v, register_t *retval) goto out; if ((uid != -1 || gid != -1) && !vnoperm(vp) && - (suser(p) || suid_clear)) { + (suser(p) || atomic_load_int(&suid_clear))) { error = VOP_GETATTR(vp, &vattr, p->p_ucred, p); if (error) goto out;