summaryrefslogtreecommitdiffstats
path: root/sys/security
diff options
context:
space:
mode:
authordavide <davide@FreeBSD.org>2013-09-07 13:45:44 +0000
committerdavide <davide@FreeBSD.org>2013-09-07 13:45:44 +0000
commitec6382d0c26c20bd51fe82da2429500f6a034707 (patch)
tree6e614255289b5312f626893bca4618a0e9379c04 /sys/security
parenteb5a66191bbcd3ddd0b695b32e9bd837c356027d (diff)
downloadFreeBSD-src-ec6382d0c26c20bd51fe82da2429500f6a034707.zip
FreeBSD-src-ec6382d0c26c20bd51fe82da2429500f6a034707.tar.gz
- Use make_dev_credf(MAKEDEV_REF) instead of the race-prone make_dev()+
dev_ref() in the clone handlers that still use it. - Don't set SI_CHEAPCLONE flag, it's not used anywhere neither in devfs (for anything real) Reviewed by: kib
Diffstat (limited to 'sys/security')
-rw-r--r--sys/security/audit/audit_pipe.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/security/audit/audit_pipe.c b/sys/security/audit/audit_pipe.c
index dc0df3e..b291975 100644
--- a/sys/security/audit/audit_pipe.c
+++ b/sys/security/audit/audit_pipe.c
@@ -672,14 +672,9 @@ audit_pipe_clone(void *arg, struct ucred *cred, char *name, int namelen,
return;
i = clone_create(&audit_pipe_clones, &audit_pipe_cdevsw, &u, dev, 0);
- if (i) {
- *dev = make_dev(&audit_pipe_cdevsw, u, UID_ROOT,
- GID_WHEEL, 0600, "%s%d", AUDIT_PIPE_NAME, u);
- if (*dev != NULL) {
- dev_ref(*dev);
- (*dev)->si_flags |= SI_CHEAPCLONE;
- }
- }
+ if (i)
+ *dev = make_dev_credf(MAKEDEV_REF, &audit_pipe_cdevsw, u, cred,
+ UID_ROOT, GID_WHEEL, 0600, "%s%d", AUDIT_PIPE_NAME, u);
}
/*
OpenPOWER on IntegriCloud