diff options
author | rwatson <rwatson@FreeBSD.org> | 2002-10-05 18:40:10 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2002-10-05 18:40:10 +0000 |
commit | 7b150b70c23f2e2e32cfee0646005b13ef1a75be (patch) | |
tree | 6ab685df96169b084c81758fa864ba83a468cb49 /sys/security/mac/mac_pipe.c | |
parent | 5846242df8bb35367b2f07511b465656800fa74a (diff) | |
download | FreeBSD-src-7b150b70c23f2e2e32cfee0646005b13ef1a75be.zip FreeBSD-src-7b150b70c23f2e2e32cfee0646005b13ef1a75be.tar.gz |
Integrate a devfs/MAC fix from the MAC tree: avoid a race condition during
devfs VOP symlink creation by introducing a new entry point to determine
the label of the devfs_dirent prior to allocation of a vnode for the
symlink.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories
Diffstat (limited to 'sys/security/mac/mac_pipe.c')
-rw-r--r-- | sys/security/mac/mac_pipe.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/security/mac/mac_pipe.c b/sys/security/mac/mac_pipe.c index 5719b01f..8a9de01 100644 --- a/sys/security/mac/mac_pipe.c +++ b/sys/security/mac/mac_pipe.c @@ -519,6 +519,10 @@ mac_policy_register(struct mac_policy_conf *mpc) mpc->mpc_ops->mpo_create_devfs_directory = mpe->mpe_function; break; + case MAC_CREATE_DEVFS_SYMLINK: + mpc->mpc_ops->mpo_create_devfs_symlink = + mpe->mpe_function; + break; case MAC_CREATE_DEVFS_VNODE: mpc->mpc_ops->mpo_create_devfs_vnode = mpe->mpe_function; @@ -2946,6 +2950,15 @@ mac_create_devfs_device(dev_t dev, struct devfs_dirent *de) MAC_PERFORM(create_devfs_device, dev, de, &de->de_label); } +void +mac_create_devfs_symlink(struct ucred *cred, struct devfs_dirent *dd, + struct devfs_dirent *de) +{ + + MAC_PERFORM(create_devfs_symlink, cred, dd, &dd->de_label, de, + &de->de_label); +} + static int mac_stdcreatevnode_ea(struct vnode *vp) { |