<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/security/mac/mac_syscalls.c, branch stable/13</title>
<subtitle>FreeBSD source tree</subtitle>
<id>https://cgit-dev.freebsd.org/src/atom?h=stable%2F13</id>
<link rel='self' href='https://cgit-dev.freebsd.org/src/atom?h=stable%2F13'/>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/'/>
<updated>2023-08-23T17:43:25Z</updated>
<entry>
<title>sys: Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-23T17:43:25Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-22T01:31:27Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=3bc80996974a61a4223eae4c1ccd47b6ee32a48a'/>
<id>urn:sha1:3bc80996974a61a4223eae4c1ccd47b6ee32a48a</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/

Similar commit in current:
(cherry picked from commit 685dc743dc3b)
</content>
</entry>
<entry>
<title>sysent: Get rid of bogus sys/sysent.h include.</title>
<updated>2022-06-17T19:35:31Z</updated>
<author>
<name>Dmitry Chagin</name>
<email>dchagin@FreeBSD.org</email>
</author>
<published>2022-05-28T17:52:17Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7aeec4eea8523210598152bd21bc0d8ccea9a97d'/>
<id>urn:sha1:7aeec4eea8523210598152bd21bc0d8ccea9a97d</id>
<content type='text'>
Where appropriate hide sysent.h under proper condition.

MFC after:	2 weeks

(cherry picked from commit 31d1b816fe139f46083f8609c34b7d129a6e2ee0)
</content>
</entry>
<entry>
<title>Convert remaining cap_rights_init users to cap_rights_init_one</title>
<updated>2021-01-12T13:16:10Z</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2021-01-12T12:11:26Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=6b3a9a0f3d2cd66145e89fdd8d07cb33a9963e8f'/>
<id>urn:sha1:6b3a9a0f3d2cd66145e89fdd8d07cb33a9963e8f</id>
<content type='text'>
semantic patch:

@@

expression rights, r;

@@

- cap_rights_init(&amp;rights, r)
+ cap_rights_init_one(&amp;rights, r)
</content>
</entry>
<entry>
<title>vfs: drop the mostly unused flags argument from VOP_UNLOCK</title>
<updated>2020-01-03T22:29:58Z</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2020-01-03T22:29:58Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=b249ce48ea5560afdcff57e72a9880b7d3132434'/>
<id>urn:sha1:b249ce48ea5560afdcff57e72a9880b7d3132434</id>
<content type='text'>
Filesystems which want to use it in limited capacity can employ the
VOP_UNLOCK_FLAGS macro.

Reviewed by:	kib (previous version)
Differential Revision:	https://reviews.freebsd.org/D21427
</content>
</entry>
<entry>
<title>Reduce duplication in __mac_*_(file|link)(2) implementation.</title>
<updated>2018-02-15T18:57:22Z</updated>
<author>
<name>Brooks Davis</name>
<email>brooks@FreeBSD.org</email>
</author>
<published>2018-02-15T18:57:22Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=d88fe103eb63660888ad7386393f75e85090b065'/>
<id>urn:sha1:d88fe103eb63660888ad7386393f75e85090b065</id>
<content type='text'>
Reviewed by:	rwatson
Obtained from:	CheriBSD
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D14175
</content>
</entry>
<entry>
<title>Do pass removing some write-only variables from the kernel.</title>
<updated>2017-12-25T04:48:39Z</updated>
<author>
<name>Alexander Kabaev</name>
<email>kan@FreeBSD.org</email>
</author>
<published>2017-12-25T04:48:39Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=151ba7933aab5c8edc094715bffd9b97d84d2407'/>
<id>urn:sha1:151ba7933aab5c8edc094715bffd9b97d84d2407</id>
<content type='text'>
This reduces noise when kernel is compiled by newer GCC versions,
such as one used by external toolchain ports.

Reviewed by: kib, andrew(sys/arm and sys/arm64), emaste(partial), erj(partial)
Reviewed by: jhb (sys/dev/pci/* sys/kern/vfs_aio.c and sys/kern/kern_synch.c)
Differential Revision: https://reviews.freebsd.org/D10385
</content>
</entry>
<entry>
<title>cred: add proc_set_cred helper</title>
<updated>2015-03-16T00:10:03Z</updated>
<author>
<name>Mateusz Guzik</name>
<email>mjg@FreeBSD.org</email>
</author>
<published>2015-03-16T00:10:03Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=daf63fd2f9a8d0402a05c2f4c7326d96cf7b0a23'/>
<id>urn:sha1:daf63fd2f9a8d0402a05c2f4c7326d96cf7b0a23</id>
<content type='text'>
The goal here is to provide one place altering process credentials.

This eases debugging and opens up posibilities to do additional work when such
an action is performed.
</content>
</entry>
<entry>
<title>Update kernel inclusions of capability.h to use capsicum.h instead; some</title>
<updated>2014-03-16T10:55:57Z</updated>
<author>
<name>Robert Watson</name>
<email>rwatson@FreeBSD.org</email>
</author>
<published>2014-03-16T10:55:57Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=4a14441044e0bdb55c81010ea92b24d87c25ee56'/>
<id>urn:sha1:4a14441044e0bdb55c81010ea92b24d87c25ee56</id>
<content type='text'>
further refinement is required as some device drivers intended to be
portable over FreeBSD versions rely on __FreeBSD_version to decide whether
to include capability.h.

MFC after:	3 weeks
</content>
</entry>
<entry>
<title>Change the cap_rights_t type from uint64_t to a structure that we can extend</title>
<updated>2013-09-05T00:09:56Z</updated>
<author>
<name>Pawel Jakub Dawidek</name>
<email>pjd@FreeBSD.org</email>
</author>
<published>2013-09-05T00:09:56Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=7008be5bd7341259037f383434a72960413cfeb8'/>
<id>urn:sha1:7008be5bd7341259037f383434a72960413cfeb8</id>
<content type='text'>
in the future in a backward compatible (API and ABI) way.

The cap_rights_t represents capability rights. We used to use one bit to
represent one right, but we are running out of spare bits. Currently the new
structure provides place for 114 rights (so 50 more than the previous
cap_rights_t), but it is possible to grow the structure to hold at least 285
rights, although we can make it even larger if 285 rights won't be enough.

The structure definition looks like this:

	struct cap_rights {
		uint64_t	cr_rights[CAP_RIGHTS_VERSION + 2];
	};

The initial CAP_RIGHTS_VERSION is 0.

The top two bits in the first element of the cr_rights[] array contain total
number of elements in the array - 2. This means if those two bits are equal to
0, we have 2 array elements.

The top two bits in all remaining array elements should be 0.
The next five bits in all array elements contain array index. Only one bit is
used and bit position in this five-bits range defines array index. This means
there can be at most five array elements in the future.

To define new right the CAPRIGHT() macro must be used. The macro takes two
arguments - an array index and a bit to set, eg.

	#define	CAP_PDKILL	CAPRIGHT(1, 0x0000000000000800ULL)

We still support aliases that combine few rights, but the rights have to belong
to the same array element, eg:

	#define	CAP_LOOKUP	CAPRIGHT(0, 0x0000000000000400ULL)
	#define	CAP_FCHMOD	CAPRIGHT(0, 0x0000000000002000ULL)

	#define	CAP_FCHMODAT	(CAP_FCHMOD | CAP_LOOKUP)

There is new API to manage the new cap_rights_t structure:

	cap_rights_t *cap_rights_init(cap_rights_t *rights, ...);
	void cap_rights_set(cap_rights_t *rights, ...);
	void cap_rights_clear(cap_rights_t *rights, ...);
	bool cap_rights_is_set(const cap_rights_t *rights, ...);

	bool cap_rights_is_valid(const cap_rights_t *rights);
	void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src);
	void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src);
	bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little);

Capability rights to the cap_rights_init(), cap_rights_set(),
cap_rights_clear() and cap_rights_is_set() functions are provided by
separating them with commas, eg:

	cap_rights_t rights;

	cap_rights_init(&amp;rights, CAP_READ, CAP_WRITE, CAP_FSTAT);

There is no need to terminate the list of rights, as those functions are
actually macros that take care of the termination, eg:

	#define	cap_rights_set(rights, ...)				\
		__cap_rights_set((rights), __VA_ARGS__, 0ULL)
	void __cap_rights_set(cap_rights_t *rights, ...);

Thanks to using one bit as an array index we can assert in those functions that
there are no two rights belonging to different array elements provided
together. For example this is illegal and will be detected, because CAP_LOOKUP
belongs to element 0 and CAP_PDKILL to element 1:

	cap_rights_init(&amp;rights, CAP_LOOKUP | CAP_PDKILL);

Providing several rights that belongs to the same array's element this way is
correct, but is not advised. It should only be used for aliases definition.

This commit also breaks compatibility with some existing Capsicum system calls,
but I see no other way to do that. This should be fine as Capsicum is still
experimental and this change is not going to 9.x.

Sponsored by:	The FreeBSD Foundation
</content>
</entry>
<entry>
<title>Remove the support for using non-mpsafe filesystem modules.</title>
<updated>2012-10-22T17:50:54Z</updated>
<author>
<name>Konstantin Belousov</name>
<email>kib@FreeBSD.org</email>
</author>
<published>2012-10-22T17:50:54Z</published>
<link rel='alternate' type='text/html' href='https://cgit-dev.freebsd.org/src/commit/?id=5050aa86cff105784877fb886a7b1d25bca5813b'/>
<id>urn:sha1:5050aa86cff105784877fb886a7b1d25bca5813b</id>
<content type='text'>
In particular, do not lock Giant conditionally when calling into the
filesystem module, remove the VFS_LOCK_GIANT() and related
macros. Stop handling buffers belonging to non-mpsafe filesystems.

The VFS_VERSION is bumped to indicate the interface change which does
not result in the interface signatures changes.

Conducted and reviewed by:	attilio
Tested by:	pho
</content>
</entry>
</feed>
