tree-wide: avoid some loaded terms

https://tools.ietf.org/html/draft-knodel-terminology-02
https://lwn.net/Articles/823224/

This gets rid of most but not occasions of these loaded terms:

1. scsi_id and friends are something that is supposed to be removed from
   our tree (see #7594)

2. The test suite defines an API used by the ubuntu CI. We can remove
   this too later, but this needs to be done in sync with the ubuntu CI.

3. In some cases the terms are part of APIs we call or where we expose
   concepts the kernel names the way it names them. (In particular all
   remaining uses of the word "slave" in our codebase are like this,
   it's used by the POSIX PTY layer, by the network subsystem, the mount
   API and the block device subsystem). Getting rid of the term in these
   contexts would mean doing some major fixes of the kernel ABI first.

Regarding the replacements: when whitelist/blacklist is used as noun we
replace with with allow list/deny list, and when used as verb with
allow-list/deny-list.
This commit is contained in:
Lennart Poettering
2020-06-25 09:00:19 +02:00
committed by Zbigniew Jędrzejewski-Szmek
parent b18573e16f
commit 6b000af4f2
51 changed files with 365 additions and 354 deletions
+3 -3
View File
@@ -1173,11 +1173,11 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
if (STR_IN_SET(field, "RestrictAddressFamilies",
"SystemCallFilter")) {
int whitelist = 1;
int allow_list = 1;
const char *p = eq;
if (*p == '~') {
whitelist = 0;
allow_list = 0;
p++;
}
@@ -1197,7 +1197,7 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
if (r < 0)
return bus_log_create_error(r);
r = sd_bus_message_append_basic(m, 'b', &whitelist);
r = sd_bus_message_append_basic(m, 'b', &allow_list);
if (r < 0)
return bus_log_create_error(r);
+1 -1
View File
@@ -51,7 +51,7 @@ int module_load_and_warn(struct kmod_ctx *ctx, const char *module, bool verbose)
"Inserted module '%s'", kmod_module_get_name(mod));
else if (err == KMOD_PROBE_APPLY_BLACKLIST)
log_full(verbose ? LOG_INFO : LOG_DEBUG,
"Module '%s' is blacklisted", kmod_module_get_name(mod));
"Module '%s' is deny-listed", kmod_module_get_name(mod));
else {
assert(err < 0);
+11 -11
View File
@@ -136,7 +136,7 @@ int bind_remount_recursive_with_mountinfo(
const char *prefix,
unsigned long new_flags,
unsigned long flags_mask,
char **blacklist,
char **deny_list,
FILE *proc_self_mountinfo) {
_cleanup_set_free_free_ Set *done = NULL;
@@ -154,8 +154,8 @@ int bind_remount_recursive_with_mountinfo(
* do not have any effect on future submounts that might get propagated, they might be writable. This includes
* future submounts that have been triggered via autofs.
*
* If the "blacklist" parameter is specified it may contain a list of subtrees to exclude from the
* remount operation. Note that we'll ignore the blacklist for the top-level path. */
* If the "deny_list" parameter is specified it may contain a list of subtrees to exclude from the
* remount operation. Note that we'll ignore the deny list for the top-level path. */
simplified = strdup(prefix);
if (!simplified)
@@ -203,13 +203,13 @@ int bind_remount_recursive_with_mountinfo(
if (!path_startswith(path, simplified))
continue;
/* Ignore this mount if it is blacklisted, but only if it isn't the top-level mount
/* Ignore this mount if it is deny-listed, but only if it isn't the top-level mount
* we shall operate on. */
if (!path_equal(path, simplified)) {
bool blacklisted = false;
bool deny_listed = false;
char **i;
STRV_FOREACH(i, blacklist) {
STRV_FOREACH(i, deny_list) {
if (path_equal(*i, simplified))
continue;
@@ -217,13 +217,13 @@ int bind_remount_recursive_with_mountinfo(
continue;
if (path_startswith(path, *i)) {
blacklisted = true;
log_debug("Not remounting %s blacklisted by %s, called for %s",
deny_listed = true;
log_debug("Not remounting %s deny-listed by %s, called for %s",
path, *i, simplified);
break;
}
}
if (blacklisted)
if (deny_listed)
continue;
}
@@ -314,7 +314,7 @@ int bind_remount_recursive(
const char *prefix,
unsigned long new_flags,
unsigned long flags_mask,
char **blacklist) {
char **deny_list) {
_cleanup_fclose_ FILE *proc_self_mountinfo = NULL;
int r;
@@ -323,7 +323,7 @@ int bind_remount_recursive(
if (r < 0)
return r;
return bind_remount_recursive_with_mountinfo(prefix, new_flags, flags_mask, blacklist, proc_self_mountinfo);
return bind_remount_recursive_with_mountinfo(prefix, new_flags, flags_mask, deny_list, proc_self_mountinfo);
}
int bind_remount_one_with_mountinfo(
+2 -2
View File
@@ -28,8 +28,8 @@
int repeat_unmount(const char *path, int flags);
int umount_recursive(const char *target, int flags);
int bind_remount_recursive(const char *prefix, unsigned long new_flags, unsigned long flags_mask, char **blacklist);
int bind_remount_recursive_with_mountinfo(const char *prefix, unsigned long new_flags, unsigned long flags_mask, char **blacklist, FILE *proc_self_mountinfo);
int bind_remount_recursive(const char *prefix, unsigned long new_flags, unsigned long flags_mask, char **deny_list);
int bind_remount_recursive_with_mountinfo(const char *prefix, unsigned long new_flags, unsigned long flags_mask, char **deny_list, FILE *proc_self_mountinfo);
int bind_remount_one_with_mountinfo(const char *path, unsigned long new_flags, unsigned long flags_mask, FILE *proc_self_mountinfo);
int mount_move_root(const char *path);
+13 -14
View File
@@ -24,7 +24,7 @@
const uint32_t seccomp_local_archs[] = {
/* Note: always list the native arch we are compiled as last, so that users can blacklist seccomp(), but our own calls to it still succeed */
/* Note: always list the native arch we are compiled as last, so that users can deny-list seccomp(), but our own calls to it still succeed */
#if defined(__x86_64__) && defined(__ILP32__)
SCMP_ARCH_X86,
@@ -1112,7 +1112,7 @@ int seccomp_parse_syscall_filter(
/* If we previously wanted to forbid a syscall and now
* we want to allow it, then remove it from the list. */
if (!(flags & SECCOMP_PARSE_INVERT) == !!(flags & SECCOMP_PARSE_WHITELIST)) {
if (!(flags & SECCOMP_PARSE_INVERT) == !!(flags & SECCOMP_PARSE_ALLOW_LIST)) {
r = hashmap_put(filter, INT_TO_PTR(id + 1), INT_TO_PTR(errno_num));
if (r < 0)
switch (r) {
@@ -1315,7 +1315,7 @@ int seccomp_protect_syslog(void) {
return 0;
}
int seccomp_restrict_address_families(Set *address_families, bool whitelist) {
int seccomp_restrict_address_families(Set *address_families, bool allow_list) {
uint32_t arch;
int r;
@@ -1362,13 +1362,13 @@ int seccomp_restrict_address_families(Set *address_families, bool whitelist) {
if (r < 0)
return r;
if (whitelist) {
if (allow_list) {
int af, first = 0, last = 0;
void *afp;
/* If this is a whitelist, we first block the address families that are out of range and then
* everything that is not in the set. First, we find the lowest and highest address family in
* the set. */
/* If this is an allow list, we first block the address families that are out of
* range and then everything that is not in the set. First, we find the lowest and
* highest address family in the set. */
SET_FOREACH(afp, address_families, i) {
af = PTR_TO_INT(afp);
@@ -1448,9 +1448,8 @@ int seccomp_restrict_address_families(Set *address_families, bool whitelist) {
} else {
void *af;
/* If this is a blacklist, then generate one rule for
* each address family that are then combined in OR
* checks. */
/* If this is a deny list, then generate one rule for each address family that are
* then combined in OR checks. */
SET_FOREACH(af, address_families, i) {
@@ -1506,11 +1505,11 @@ int seccomp_restrict_realtime(void) {
return r;
/* Go through all policies with lower values than that, and block them -- unless they appear in the
* whitelist. */
* allow list. */
for (p = 0; p < max_policy; p++) {
bool good = false;
/* Check if this is in the whitelist. */
/* Check if this is in the allow list. */
for (i = 0; i < ELEMENTSOF(permitted_policies); i++)
if (permitted_policies[i] == p) {
good = true;
@@ -1533,8 +1532,8 @@ int seccomp_restrict_realtime(void) {
}
}
/* Blacklist all other policies, i.e. the ones with higher values. Note that all comparisons are
* unsigned here, hence no need no check for < 0 values. */
/* Deny-list all other policies, i.e. the ones with higher values. Note that all comparisons
* are unsigned here, hence no need no check for < 0 values. */
r = seccomp_rule_add_exact(
seccomp,
SCMP_ACT_ERRNO(EPERM),
+2 -2
View File
@@ -66,7 +66,7 @@ int seccomp_load_syscall_filter_set_raw(uint32_t default_action, Hashmap* set, u
typedef enum SeccompParseFlags {
SECCOMP_PARSE_INVERT = 1 << 0,
SECCOMP_PARSE_WHITELIST = 1 << 1,
SECCOMP_PARSE_ALLOW_LIST = 1 << 1,
SECCOMP_PARSE_LOG = 1 << 2,
SECCOMP_PARSE_PERMISSIVE = 1 << 3,
} SeccompParseFlags;
@@ -83,7 +83,7 @@ int seccomp_restrict_archs(Set *archs);
int seccomp_restrict_namespaces(unsigned long retain);
int seccomp_protect_sysctl(void);
int seccomp_protect_syslog(void);
int seccomp_restrict_address_families(Set *address_families, bool whitelist);
int seccomp_restrict_address_families(Set *address_families, bool allow_list);
int seccomp_restrict_realtime(void);
int seccomp_memory_deny_write_execute(void);
int seccomp_lock_personality(unsigned long personality);