mirror of
https://github.com/openbsd/src.git
synced 2025-01-03 06:45:37 -08:00
Unlock fs_sysctl(). It is the only `suid_clear' variable - atomically
accessed integer. ok bluhm
This commit is contained in:
parent
16df6568a5
commit
78b7da8824
@ -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 $ */
|
/* $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;
|
fn = net_sysctl;
|
||||||
break;
|
break;
|
||||||
case CTL_FS:
|
case CTL_FS:
|
||||||
|
dolock = 0;
|
||||||
fn = fs_sysctl;
|
fn = fs_sysctl;
|
||||||
break;
|
break;
|
||||||
case CTL_VFS:
|
case CTL_VFS:
|
||||||
|
@ -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 $ */
|
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -72,6 +72,11 @@
|
|||||||
|
|
||||||
#include "softraid.h"
|
#include "softraid.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Locks used to protect data:
|
||||||
|
* a atomic
|
||||||
|
*/
|
||||||
|
|
||||||
void sr_quiesce(void);
|
void sr_quiesce(void);
|
||||||
|
|
||||||
enum vtype iftovt_tab[16] = {
|
enum vtype iftovt_tab[16] = {
|
||||||
@ -84,8 +89,8 @@ int vttoif_tab[9] = {
|
|||||||
S_IFSOCK, S_IFIFO, S_IFMT,
|
S_IFSOCK, S_IFIFO, S_IFMT,
|
||||||
};
|
};
|
||||||
|
|
||||||
int prtactive = 0; /* 1 => print out reclaim of active vnodes */
|
int prtactive = 0; /* 1 => print out reclaim of active vnodes */
|
||||||
int suid_clear = 1; /* 1 => clear SUID / SGID on owner change */
|
int suid_clear = 1; /* [a] 1 => clear SUID / SGID on owner change */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Insq/Remq for the vnode usage lists.
|
* Insq/Remq for the vnode usage lists.
|
||||||
|
@ -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 $ */
|
/* $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;
|
goto out;
|
||||||
if ((uid != -1 || gid != -1) &&
|
if ((uid != -1 || gid != -1) &&
|
||||||
!vnoperm(vp) &&
|
!vnoperm(vp) &&
|
||||||
(suser(p) || suid_clear)) {
|
(suser(p) || atomic_load_int(&suid_clear))) {
|
||||||
error = VOP_GETATTR(vp, &vattr, p->p_ucred, p);
|
error = VOP_GETATTR(vp, &vattr, p->p_ucred, p);
|
||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
@ -2523,7 +2523,7 @@ sys_lchown(struct proc *p, void *v, register_t *retval)
|
|||||||
goto out;
|
goto out;
|
||||||
if ((uid != -1 || gid != -1) &&
|
if ((uid != -1 || gid != -1) &&
|
||||||
!vnoperm(vp) &&
|
!vnoperm(vp) &&
|
||||||
(suser(p) || suid_clear)) {
|
(suser(p) || atomic_load_int(&suid_clear))) {
|
||||||
error = VOP_GETATTR(vp, &vattr, p->p_ucred, p);
|
error = VOP_GETATTR(vp, &vattr, p->p_ucred, p);
|
||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
@ -2573,7 +2573,7 @@ sys_fchown(struct proc *p, void *v, register_t *retval)
|
|||||||
goto out;
|
goto out;
|
||||||
if ((uid != -1 || gid != -1) &&
|
if ((uid != -1 || gid != -1) &&
|
||||||
!vnoperm(vp) &&
|
!vnoperm(vp) &&
|
||||||
(suser(p) || suid_clear)) {
|
(suser(p) || atomic_load_int(&suid_clear))) {
|
||||||
error = VOP_GETATTR(vp, &vattr, p->p_ucred, p);
|
error = VOP_GETATTR(vp, &vattr, p->p_ucred, p);
|
||||||
if (error)
|
if (error)
|
||||||
goto out;
|
goto out;
|
||||||
|
Loading…
Reference in New Issue
Block a user