mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Add an additional MAC check to the UNIX domain socket connect path:
check that the subject has read/write access to the vnode using the vnode MAC check. MFC after: 3 weeks Submitted by: Spencer Minear <spencer_minear at securecomputing dot com> Obtained from: TrustedBSD Project
This commit is contained in:
parent
0cd31a0d75
commit
6fac927ccc
1 changed files with 5 additions and 0 deletions
|
|
@ -965,6 +965,11 @@ unp_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
|
|||
error = ENOTSOCK;
|
||||
goto bad;
|
||||
}
|
||||
#ifdef MAC
|
||||
error = mac_check_vnode_open(td->td_ucred, vp, VWRITE | VREAD);
|
||||
if (error)
|
||||
goto bad;
|
||||
#endif
|
||||
error = VOP_ACCESS(vp, VWRITE, td->td_ucred, td);
|
||||
if (error)
|
||||
goto bad;
|
||||
|
|
|
|||
Loading…
Reference in a new issue