<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src-test/sys/security/mac, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src-test/atom?h=main</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src-test/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/'/>
<updated>2020-11-19T06:30:25Z</updated>
<entry>
<title>pipe: allow for lockless pipe_stat</title>
<updated>2020-11-19T06:30:25Z</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2020-11-19T06:30:25Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=89744405e64b2116fbdd7d0e866a34731c96e4d5'/>
<id>urn:sha1:89744405e64b2116fbdd7d0e866a34731c96e4d5</id>
<content type='text'>
pipes get stated all thet time and this avoidably contributed to contention.
The pipe lock is only held to accomodate MAC and to check the type.

Since normally there is no probe for pipe stat depessimize this by having the
flag.

The pipe_state field gets modified with locks held all the time and it's not
feasible to convert them to use atomic store. Move the type flag away to a
separate variable as a simple cleanup and to provide stable field to read.
Use short for both fields to avoid growing the struct.

While here short-circuit MAC for pipe_poll as well.
</content>
</entry>
<entry>
<title>mac_framework.h: fix build with DEBUG_VFS_LOCKS and !MAC</title>
<updated>2020-09-03T20:30:52Z</updated>
<author>
<name>Andriy Gapon</name>
<email>avg@FreeBSD.org</email>
</author>
<published>2020-09-03T20:30:52Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=137d26e8a378c50b439f3bc3f26ea5d7660c5607'/>
<id>urn:sha1:137d26e8a378c50b439f3bc3f26ea5d7660c5607</id>
<content type='text'>
I have such a custom kernel configuration and its build failed with:
linking kernel.full
ld: error: undefined symbol: mac_vnode_assert_locked
&gt;&gt;&gt; referenced by mac_framework.h:556 (/usr/devel/git/apu2c4/sys/security/mac/mac_framework.h:556)
&gt;&gt;&gt;               tmpfs_vnops.o:(mac_vnode_check_stat)
&gt;&gt;&gt; referenced by mac_framework.h:556 (/usr/devel/git/apu2c4/sys/security/mac/mac_framework.h:556)
&gt;&gt;&gt;               vfs_default.o:(mac_vnode_check_stat)
&gt;&gt;&gt; referenced by mac_framework.h:556 (/usr/devel/git/apu2c4/sys/security/mac/mac_framework.h:556)
&gt;&gt;&gt;               ufs_vnops.o:(mac_vnode_check_stat)
</content>
</entry>
<entry>
<title>security: clean up empty lines in .c and .h files</title>
<updated>2020-09-01T21:26:00Z</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2020-09-01T21:26:00Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=e5ecee7440496904939e936501d0db93bed15415'/>
<id>urn:sha1:e5ecee7440496904939e936501d0db93bed15415</id>
<content type='text'>
</content>
</entry>
<entry>
<title>mac: even up all entry points to the same scheme</title>
<updated>2020-08-06T00:23:06Z</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2020-08-06T00:23:06Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=4ec34a908bb2caf1967fd6e26e152e0bf2e4534e'/>
<id>urn:sha1:4ec34a908bb2caf1967fd6e26e152e0bf2e4534e</id>
<content type='text'>
- use a macro for checking whether the site is enabled
- expand it to 0 if mac is not compiled in to begin with
</content>
</entry>
<entry>
<title>vfs: add a cheaper entry for mac_vnode_check_access</title>
<updated>2020-08-05T07:34:45Z</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2020-08-05T07:34:45Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=18f67bc413e8a4e6b313c023e8612603f1ea17c0'/>
<id>urn:sha1:18f67bc413e8a4e6b313c023e8612603f1ea17c0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix tinderbox build after r363714</title>
<updated>2020-07-30T22:56:57Z</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2020-07-30T22:56:57Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=5b0acaf75ff8d416a51c820b1c062dada0edaf66'/>
<id>urn:sha1:5b0acaf75ff8d416a51c820b1c062dada0edaf66</id>
<content type='text'>
</content>
</entry>
<entry>
<title>vfs: elide MAC-induced locking on rename if there are no relevant hoooks</title>
<updated>2020-07-29T17:05:31Z</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2020-07-29T17:05:31Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=fad6dd772d15214036aeea34a1c280dc8390fdfb'/>
<id>urn:sha1:fad6dd772d15214036aeea34a1c280dc8390fdfb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>vfs: add the infrastructure for lockless lookup</title>
<updated>2020-07-25T10:32:45Z</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2020-07-25T10:32:45Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=07d2145a17178e9df663c90cc45d249502f7f768'/>
<id>urn:sha1:07d2145a17178e9df663c90cc45d249502f7f768</id>
<content type='text'>
Reviewed by:    kib
Tested by:      pho (in a patchset)
Differential Revision:	https://reviews.freebsd.org/D25577
</content>
</entry>
<entry>
<title>vfs: fix vn_poll performance with either MAC or AUDIT</title>
<updated>2020-07-16T14:09:18Z</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2020-07-16T14:09:18Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=3ea3fbe685e0c7858c0bf5f4d29714b8fbbe69a1'/>
<id>urn:sha1:3ea3fbe685e0c7858c0bf5f4d29714b8fbbe69a1</id>
<content type='text'>
The code would unconditionally lock the vnode to audit or call the
mac hoook, even if neither want to do anything. Pre-check the state
to avoid locking in the common case of nothing to do.

Note this code should not be normally executed anyway as vnodes are
always return ready. However, poll1/2 from will-it-scale use regular
files for benchmarking, presumably to focus on the interface itself
as the vnode handler is not supposed to do almost anything.

This in particular fixes poll2 which passes 128 fds.

$ ./poll2_processes -s 10
before: 134411
after:  271572
</content>
</entry>
<entry>
<title>vfs: fix MAC/AUDIT mismatch in vn_poll</title>
<updated>2020-07-16T14:04:28Z</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2020-07-16T14:04:28Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src-test/commit/?id=ab06a3051743a8347fb2bb7cbf47525bdec4946a'/>
<id>urn:sha1:ab06a3051743a8347fb2bb7cbf47525bdec4946a</id>
<content type='text'>
Auditing would not be performed without MAC compiled in.
</content>
</entry>
</feed>
