forked from skristiansson/linux
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'selinux-pr-20201012' of git://git.kernel.org/pub/scm/linux…
…/kernel/git/pcmoore/selinux Pull selinux updates from Paul Moore: "A decent number of SELinux patches for v5.10, twenty two in total. The highlights are listed below, but all of the patches pass our test suite and merge cleanly. - A number of changes to how the SELinux policy is loaded and managed inside the kernel with the goal of improving the atomicity of a SELinux policy load operation. These changes account for the bulk of the diffstat as well as the patch count. A special thanks to everyone who contributed patches and fixes for this work. - Convert the SELinux policy read-write lock to RCU. - A tracepoint was added for audited SELinux access control events; this should help provide a more unified backtrace across kernel and userspace. - Allow the removal of security.selinux xattrs when a SELinux policy is not loaded. - Enable policy capabilities in SELinux policies created with the scripts/selinux/mdp tool. - Provide some "no sooner than" dates for the SELinux checkreqprot sysfs deprecation" * tag 'selinux-pr-20201012' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: (22 commits) selinux: provide a "no sooner than" date for the checkreqprot removal selinux: Add helper functions to get and set checkreqprot selinux: access policycaps with READ_ONCE/WRITE_ONCE selinux: simplify away security_policydb_len() selinux: move policy mutex to selinux_state, use in lockdep checks selinux: fix error handling bugs in security_load_policy() selinux: convert policy read-write lock to RCU selinux: delete repeated words in comments selinux: add basic filtering for audit trace events selinux: add tracepoint on audited events selinux: Create new booleans and class dirs out of tree selinux: Standardize string literal usage for selinuxfs directory names selinux: Refactor selinuxfs directory populating functions selinux: Create function for selinuxfs directory cleanup selinux: permit removing security.selinux xattr before policy load selinux: fix memdup.cocci warnings selinux: avoid dereferencing the policy prior to initialization selinux: fix allocation failure check on newpolicy->sidtab selinux: refactor changing booleans selinux: move policy commit after updating selinuxfs ...
- Loading branch information
Showing
21 changed files
with
1,130 additions
and
499 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
/* | ||
* Authors: Thiébaud Weksteen <tweek@google.com> | ||
* Peter Enderborg <Peter.Enderborg@sony.com> | ||
*/ | ||
#undef TRACE_SYSTEM | ||
#define TRACE_SYSTEM avc | ||
|
||
#if !defined(_TRACE_SELINUX_H) || defined(TRACE_HEADER_MULTI_READ) | ||
#define _TRACE_SELINUX_H | ||
|
||
#include <linux/tracepoint.h> | ||
|
||
TRACE_EVENT(selinux_audited, | ||
|
||
TP_PROTO(struct selinux_audit_data *sad, | ||
char *scontext, | ||
char *tcontext, | ||
const char *tclass | ||
), | ||
|
||
TP_ARGS(sad, scontext, tcontext, tclass), | ||
|
||
TP_STRUCT__entry( | ||
__field(u32, requested) | ||
__field(u32, denied) | ||
__field(u32, audited) | ||
__field(int, result) | ||
__string(scontext, scontext) | ||
__string(tcontext, tcontext) | ||
__string(tclass, tclass) | ||
), | ||
|
||
TP_fast_assign( | ||
__entry->requested = sad->requested; | ||
__entry->denied = sad->denied; | ||
__entry->audited = sad->audited; | ||
__entry->result = sad->result; | ||
__assign_str(tcontext, tcontext); | ||
__assign_str(scontext, scontext); | ||
__assign_str(tclass, tclass); | ||
), | ||
|
||
TP_printk("requested=0x%x denied=0x%x audited=0x%x result=%d scontext=%s tcontext=%s tclass=%s", | ||
__entry->requested, __entry->denied, __entry->audited, __entry->result, | ||
__get_str(scontext), __get_str(tcontext), __get_str(tclass) | ||
) | ||
); | ||
|
||
#endif | ||
|
||
/* This part must be outside protection */ | ||
#include <trace/define_trace.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef _SELINUX_POLICYCAP_H_ | ||
#define _SELINUX_POLICYCAP_H_ | ||
|
||
/* Policy capabilities */ | ||
enum { | ||
POLICYDB_CAPABILITY_NETPEER, | ||
POLICYDB_CAPABILITY_OPENPERM, | ||
POLICYDB_CAPABILITY_EXTSOCKCLASS, | ||
POLICYDB_CAPABILITY_ALWAYSNETWORK, | ||
POLICYDB_CAPABILITY_CGROUPSECLABEL, | ||
POLICYDB_CAPABILITY_NNP_NOSUID_TRANSITION, | ||
POLICYDB_CAPABILITY_GENFS_SECLABEL_SYMLINKS, | ||
__POLICYDB_CAPABILITY_MAX | ||
}; | ||
#define POLICYDB_CAPABILITY_MAX (__POLICYDB_CAPABILITY_MAX - 1) | ||
|
||
extern const char *selinux_policycap_names[__POLICYDB_CAPABILITY_MAX]; | ||
|
||
#endif /* _SELINUX_POLICYCAP_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef _SELINUX_POLICYCAP_NAMES_H_ | ||
#define _SELINUX_POLICYCAP_NAMES_H_ | ||
|
||
#include "policycap.h" | ||
|
||
/* Policy capability names */ | ||
const char *selinux_policycap_names[__POLICYDB_CAPABILITY_MAX] = { | ||
"network_peer_controls", | ||
"open_perms", | ||
"extended_socket_class", | ||
"always_check_network", | ||
"cgroup_seclabel", | ||
"nnp_nosuid_transition", | ||
"genfs_seclabel_symlinks" | ||
}; | ||
|
||
#endif /* _SELINUX_POLICYCAP_NAMES_H_ */ |
Oops, something went wrong.