summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2019-06-07 14:00:14 -0400
committerDavid S. Miller <davem@davemloft.net>2019-06-07 14:00:14 -0400
commita6cdeeb16bff89c8486324f53577db058cbe81ba (patch)
treede2d38e10f5768bdf1d2902112a4803d0ae767f3 /security
parent96524ea4be04683bb3ad8ebaedcbe3a6e34302de (diff)
parent1e1d926369545ea09c98c6c7f5d109aa4ee0cd0b (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Some ISDN files that got removed in net-next had some changes done in mainline, take the removals. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'security')
-rw-r--r--security/commoncap.c7
-rw-r--r--security/integrity/evm/evm_crypto.c3
-rw-r--r--security/integrity/ima/ima_kexec.c6
-rw-r--r--security/integrity/ima/ima_policy.c28
-rw-r--r--security/keys/compat.c6
-rw-r--r--security/keys/compat_dh.c6
-rw-r--r--security/keys/dh.c6
-rw-r--r--security/keys/internal.h6
-rw-r--r--security/keys/key.c6
-rw-r--r--security/keys/keyctl.c6
-rw-r--r--security/keys/keyring.c6
-rw-r--r--security/keys/permission.c6
-rw-r--r--security/keys/proc.c6
-rw-r--r--security/keys/process_keys.c6
-rw-r--r--security/keys/request_key.c6
-rw-r--r--security/keys/request_key_auth.c6
-rw-r--r--security/keys/user_defined.c6
-rw-r--r--security/security.c6
18 files changed, 35 insertions, 93 deletions
diff --git a/security/commoncap.c b/security/commoncap.c
index c477fb673701..c0b9664ee49e 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -1,10 +1,5 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
1/* Common capabilities, needed by capability.o. 2/* Common capabilities, needed by capability.o.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 */ 3 */
9 4
10#include <linux/capability.h> 5#include <linux/capability.h>
diff --git a/security/integrity/evm/evm_crypto.c b/security/integrity/evm/evm_crypto.c
index e11564eb645b..82a38e801ee4 100644
--- a/security/integrity/evm/evm_crypto.c
+++ b/security/integrity/evm/evm_crypto.c
@@ -89,6 +89,9 @@ static struct shash_desc *init_desc(char type, uint8_t hash_algo)
89 tfm = &hmac_tfm; 89 tfm = &hmac_tfm;
90 algo = evm_hmac; 90 algo = evm_hmac;
91 } else { 91 } else {
92 if (hash_algo >= HASH_ALGO__LAST)
93 return ERR_PTR(-EINVAL);
94
92 tfm = &evm_tfm[hash_algo]; 95 tfm = &evm_tfm[hash_algo];
93 algo = hash_algo_name[hash_algo]; 96 algo = hash_algo_name[hash_algo];
94 } 97 }
diff --git a/security/integrity/ima/ima_kexec.c b/security/integrity/ima/ima_kexec.c
index d6f32807b347..9e94eca48b89 100644
--- a/security/integrity/ima/ima_kexec.c
+++ b/security/integrity/ima/ima_kexec.c
@@ -1,14 +1,10 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
1/* 2/*
2 * Copyright (C) 2016 IBM Corporation 3 * Copyright (C) 2016 IBM Corporation
3 * 4 *
4 * Authors: 5 * Authors:
5 * Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com> 6 * Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
6 * Mimi Zohar <zohar@linux.vnet.ibm.com> 7 * Mimi Zohar <zohar@linux.vnet.ibm.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 */ 8 */
13#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 9#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
14 10
diff --git a/security/integrity/ima/ima_policy.c b/security/integrity/ima/ima_policy.c
index e0cc323f948f..1cc822a59054 100644
--- a/security/integrity/ima/ima_policy.c
+++ b/security/integrity/ima/ima_policy.c
@@ -498,10 +498,11 @@ static void add_rules(struct ima_rule_entry *entries, int count,
498 498
499 list_add_tail(&entry->list, &ima_policy_rules); 499 list_add_tail(&entry->list, &ima_policy_rules);
500 } 500 }
501 if (entries[i].action == APPRAISE) 501 if (entries[i].action == APPRAISE) {
502 temp_ima_appraise |= ima_appraise_flag(entries[i].func); 502 temp_ima_appraise |= ima_appraise_flag(entries[i].func);
503 if (entries[i].func == POLICY_CHECK) 503 if (entries[i].func == POLICY_CHECK)
504 temp_ima_appraise |= IMA_APPRAISE_POLICY; 504 temp_ima_appraise |= IMA_APPRAISE_POLICY;
505 }
505 } 506 }
506} 507}
507 508
@@ -1146,10 +1147,10 @@ enum {
1146}; 1147};
1147 1148
1148static const char *const mask_tokens[] = { 1149static const char *const mask_tokens[] = {
1149 "MAY_EXEC", 1150 "^MAY_EXEC",
1150 "MAY_WRITE", 1151 "^MAY_WRITE",
1151 "MAY_READ", 1152 "^MAY_READ",
1152 "MAY_APPEND" 1153 "^MAY_APPEND"
1153}; 1154};
1154 1155
1155#define __ima_hook_stringify(str) (#str), 1156#define __ima_hook_stringify(str) (#str),
@@ -1209,6 +1210,7 @@ int ima_policy_show(struct seq_file *m, void *v)
1209 struct ima_rule_entry *entry = v; 1210 struct ima_rule_entry *entry = v;
1210 int i; 1211 int i;
1211 char tbuf[64] = {0,}; 1212 char tbuf[64] = {0,};
1213 int offset = 0;
1212 1214
1213 rcu_read_lock(); 1215 rcu_read_lock();
1214 1216
@@ -1232,15 +1234,17 @@ int ima_policy_show(struct seq_file *m, void *v)
1232 if (entry->flags & IMA_FUNC) 1234 if (entry->flags & IMA_FUNC)
1233 policy_func_show(m, entry->func); 1235 policy_func_show(m, entry->func);
1234 1236
1235 if (entry->flags & IMA_MASK) { 1237 if ((entry->flags & IMA_MASK) || (entry->flags & IMA_INMASK)) {
1238 if (entry->flags & IMA_MASK)
1239 offset = 1;
1236 if (entry->mask & MAY_EXEC) 1240 if (entry->mask & MAY_EXEC)
1237 seq_printf(m, pt(Opt_mask), mt(mask_exec)); 1241 seq_printf(m, pt(Opt_mask), mt(mask_exec) + offset);
1238 if (entry->mask & MAY_WRITE) 1242 if (entry->mask & MAY_WRITE)
1239 seq_printf(m, pt(Opt_mask), mt(mask_write)); 1243 seq_printf(m, pt(Opt_mask), mt(mask_write) + offset);
1240 if (entry->mask & MAY_READ) 1244 if (entry->mask & MAY_READ)
1241 seq_printf(m, pt(Opt_mask), mt(mask_read)); 1245 seq_printf(m, pt(Opt_mask), mt(mask_read) + offset);
1242 if (entry->mask & MAY_APPEND) 1246 if (entry->mask & MAY_APPEND)
1243 seq_printf(m, pt(Opt_mask), mt(mask_append)); 1247 seq_printf(m, pt(Opt_mask), mt(mask_append) + offset);
1244 seq_puts(m, " "); 1248 seq_puts(m, " ");
1245 } 1249 }
1246 1250
diff --git a/security/keys/compat.c b/security/keys/compat.c
index 9482df601dc3..35ce47ce2285 100644
--- a/security/keys/compat.c
+++ b/security/keys/compat.c
@@ -1,12 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
1/* 32-bit compatibility syscall for 64-bit systems 2/* 32-bit compatibility syscall for 64-bit systems
2 * 3 *
3 * Copyright (C) 2004-5 Red Hat, Inc. All Rights Reserved. 4 * Copyright (C) 2004-5 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com) 5 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */ 6 */
11 7
12#include <linux/syscalls.h> 8#include <linux/syscalls.h>
diff --git a/security/keys/compat_dh.c b/security/keys/compat_dh.c
index aa6b34cafe5f..19384e7e976c 100644
--- a/security/keys/compat_dh.c
+++ b/security/keys/compat_dh.c
@@ -1,11 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
1/* 32-bit compatibility syscall for 64-bit systems for DH operations 2/* 32-bit compatibility syscall for 64-bit systems for DH operations
2 * 3 *
3 * Copyright (C) 2016 Stephan Mueller <smueller@chronox.de> 4 * Copyright (C) 2016 Stephan Mueller <smueller@chronox.de>
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */ 5 */
10 6
11#include <linux/uaccess.h> 7#include <linux/uaccess.h>
diff --git a/security/keys/dh.c b/security/keys/dh.c
index 23f95dec771b..c4c629bb1c03 100644
--- a/security/keys/dh.c
+++ b/security/keys/dh.c
@@ -1,11 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
1/* Crypto operations using stored keys 2/* Crypto operations using stored keys
2 * 3 *
3 * Copyright (c) 2016, Intel Corporation 4 * Copyright (c) 2016, Intel Corporation
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */ 5 */
10 6
11#include <linux/slab.h> 7#include <linux/slab.h>
diff --git a/security/keys/internal.h b/security/keys/internal.h
index 8f533c81aa8d..d59bc25a9249 100644
--- a/security/keys/internal.h
+++ b/security/keys/internal.h
@@ -1,12 +1,8 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
1/* Authentication token and access key management internal defs 2/* Authentication token and access key management internal defs
2 * 3 *
3 * Copyright (C) 2003-5, 2007 Red Hat, Inc. All Rights Reserved. 4 * Copyright (C) 2003-5, 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com) 5 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */ 6 */
11 7
12#ifndef _INTERNAL_H 8#ifndef _INTERNAL_H
diff --git a/security/keys/key.c b/security/keys/key.c
index 696f1c092c50..9a6108aefae9 100644
--- a/security/keys/key.c
+++ b/security/keys/key.c
@@ -1,12 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
1/* Basic authentication token and access key management 2/* Basic authentication token and access key management
2 * 3 *
3 * Copyright (C) 2004-2008 Red Hat, Inc. All Rights Reserved. 4 * Copyright (C) 2004-2008 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com) 5 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */ 6 */
11 7
12#include <linux/export.h> 8#include <linux/export.h>
diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
index 3e4053a217c3..5aa605ef8d9d 100644
--- a/security/keys/keyctl.c
+++ b/security/keys/keyctl.c
@@ -1,12 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
1/* Userspace key control operations 2/* Userspace key control operations
2 * 3 *
3 * Copyright (C) 2004-5 Red Hat, Inc. All Rights Reserved. 4 * Copyright (C) 2004-5 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com) 5 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */ 6 */
11 7
12#include <linux/init.h> 8#include <linux/init.h>
diff --git a/security/keys/keyring.c b/security/keys/keyring.c
index e14f09e3a4b0..e311cc5df358 100644
--- a/security/keys/keyring.c
+++ b/security/keys/keyring.c
@@ -1,12 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
1/* Keyring handling 2/* Keyring handling
2 * 3 *
3 * Copyright (C) 2004-2005, 2008, 2013 Red Hat, Inc. All Rights Reserved. 4 * Copyright (C) 2004-2005, 2008, 2013 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com) 5 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */ 6 */
11 7
12#include <linux/export.h> 8#include <linux/export.h>
diff --git a/security/keys/permission.c b/security/keys/permission.c
index 06df9d5e7572..085f907b64ac 100644
--- a/security/keys/permission.c
+++ b/security/keys/permission.c
@@ -1,12 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
1/* Key permission checking 2/* Key permission checking
2 * 3 *
3 * Copyright (C) 2005 Red Hat, Inc. All Rights Reserved. 4 * Copyright (C) 2005 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com) 5 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */ 6 */
11 7
12#include <linux/export.h> 8#include <linux/export.h>
diff --git a/security/keys/proc.c b/security/keys/proc.c
index 78ac305d715e..4e3266a2529e 100644
--- a/security/keys/proc.c
+++ b/security/keys/proc.c
@@ -1,12 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
1/* procfs files for key database enumeration 2/* procfs files for key database enumeration
2 * 3 *
3 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. 4 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com) 5 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */ 6 */
11 7
12#include <linux/init.h> 8#include <linux/init.h>
diff --git a/security/keys/process_keys.c b/security/keys/process_keys.c
index f05f7125a7d5..0b9406bf60e5 100644
--- a/security/keys/process_keys.c
+++ b/security/keys/process_keys.c
@@ -1,12 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
1/* Manage a process's keyrings 2/* Manage a process's keyrings
2 * 3 *
3 * Copyright (C) 2004-2005, 2008 Red Hat, Inc. All Rights Reserved. 4 * Copyright (C) 2004-2005, 2008 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com) 5 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */ 6 */
11 7
12#include <linux/init.h> 8#include <linux/init.h>
diff --git a/security/keys/request_key.c b/security/keys/request_key.c
index 75d87f9e0f49..8ae3b7b18801 100644
--- a/security/keys/request_key.c
+++ b/security/keys/request_key.c
@@ -1,13 +1,9 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
1/* Request a key from userspace 2/* Request a key from userspace
2 * 3 *
3 * Copyright (C) 2004-2007 Red Hat, Inc. All Rights Reserved. 4 * Copyright (C) 2004-2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com) 5 * Written by David Howells (dhowells@redhat.com)
5 * 6 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 * See Documentation/security/keys/request-key.rst 7 * See Documentation/security/keys/request-key.rst
12 */ 8 */
13 9
diff --git a/security/keys/request_key_auth.c b/security/keys/request_key_auth.c
index bda6201c6c45..e45b5cf3b97f 100644
--- a/security/keys/request_key_auth.c
+++ b/security/keys/request_key_auth.c
@@ -1,13 +1,9 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
1/* Request key authorisation token key definition. 2/* Request key authorisation token key definition.
2 * 3 *
3 * Copyright (C) 2005 Red Hat, Inc. All Rights Reserved. 4 * Copyright (C) 2005 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com) 5 * Written by David Howells (dhowells@redhat.com)
5 * 6 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 * See Documentation/security/keys/request-key.rst 7 * See Documentation/security/keys/request-key.rst
12 */ 8 */
13 9
diff --git a/security/keys/user_defined.c b/security/keys/user_defined.c
index 5666fe0352f7..6f12de4ce549 100644
--- a/security/keys/user_defined.c
+++ b/security/keys/user_defined.c
@@ -1,12 +1,8 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
1/* user_defined.c: user defined key type 2/* user_defined.c: user defined key type
2 * 3 *
3 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved. 4 * Copyright (C) 2004 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com) 5 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */ 6 */
11 7
12#include <linux/export.h> 8#include <linux/export.h>
diff --git a/security/security.c b/security/security.c
index 613a5c00e602..f493db0bf62a 100644
--- a/security/security.c
+++ b/security/security.c
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0-or-later
1/* 2/*
2 * Security plug functions 3 * Security plug functions
3 * 4 *
@@ -5,11 +6,6 @@
5 * Copyright (C) 2001-2002 Greg Kroah-Hartman <greg@kroah.com> 6 * Copyright (C) 2001-2002 Greg Kroah-Hartman <greg@kroah.com>
6 * Copyright (C) 2001 Networks Associates Technology, Inc <ssmalley@nai.com> 7 * Copyright (C) 2001 Networks Associates Technology, Inc <ssmalley@nai.com>
7 * Copyright (C) 2016 Mellanox Technologies 8 * Copyright (C) 2016 Mellanox Technologies
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 */ 9 */
14 10
15#define pr_fmt(fmt) "LSM: " fmt 11#define pr_fmt(fmt) "LSM: " fmt