]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Obtain a shared lock instead of exclusive in the MAC/veriexec
authorstevek <stevek@FreeBSD.org>
Fri, 17 May 2019 18:13:43 +0000 (18:13 +0000)
committerstevek <stevek@FreeBSD.org>
Fri, 17 May 2019 18:13:43 +0000 (18:13 +0000)
commit71f0d8907779e1049954949a4705994f00fe3dd7
tree7166415a8d0a55a3203cb995f0e7ea4ea8075e4e
parent412e9689989cab76d624530a3480a7c26ab90b3d
Obtain a shared lock instead of exclusive in the MAC/veriexec
MAC_VERIEXEC_CHECK_PATH_SYSCALL per-MAC policy system call.

When we are checking the status of the fingerprint on a vnode using the
per-MAC-policy syscall, we do not need an exclusive lock on the vnode.

Even if there is more than one thread requesting the status at the same time,
the worst we can end up doing is processing the file more than once.

This can potentially be improved in the future with offloading the fingerprint
evaluation to a separate thread and blocking until the update completes. But
for now the race is acceptable.

Obtained from: Juniper Networks, Inc.
MFC after: 1 week
sys/security/mac_veriexec/mac_veriexec.c