]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
security: audit and remove any unnecessary uses of module.h
authorPaul Gortmaker <paul.gortmaker@windriver.com>
Sun, 9 Dec 2018 20:36:29 +0000 (15:36 -0500)
committerJames Morris <james.morris@microsoft.com>
Wed, 12 Dec 2018 22:58:51 +0000 (14:58 -0800)
Historically a lot of these existed because we did not have
a distinction between what was modular code and what was providing
support to modules via EXPORT_SYMBOL and friends.  That changed
when we forked out support for the latter into the export.h file.
This means we should be able to reduce the usage of module.h
in code that is obj-y Makefile or bool Kconfig.

The advantage in removing such instances is that module.h itself
sources about 15 other headers; adding significantly to what we feed
cpp, and it can obscure what headers we are effectively using.

Since module.h might have been the implicit source for init.h
(for __init) and for export.h (for EXPORT_SYMBOL) we consider each
instance for the presence of either and replace as needed.

Cc: James Morris <jmorris@namei.org>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: John Johansen <john.johansen@canonical.com>
Cc: Mimi Zohar <zohar@linux.ibm.com>
Cc: Dmitry Kasatkin <dmitry.kasatkin@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Cc: linux-security-module@vger.kernel.org
Cc: linux-integrity@vger.kernel.org
Cc: keyrings@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: James Morris <james.morris@microsoft.com>
24 files changed:
security/apparmor/apparmorfs.c
security/commoncap.c
security/integrity/evm/evm_crypto.c
security/integrity/evm/evm_posix_acl.c
security/integrity/evm/evm_secfs.c
security/integrity/iint.c
security/integrity/ima/ima_api.c
security/integrity/ima/ima_appraise.c
security/integrity/ima/ima_fs.c
security/integrity/ima/ima_init.c
security/integrity/ima/ima_policy.c
security/integrity/ima/ima_queue.c
security/keys/encrypted-keys/masterkey_trusted.c
security/keys/gc.c
security/keys/key.c
security/keys/keyctl.c
security/keys/keyring.c
security/keys/permission.c
security/keys/proc.c
security/keys/process_keys.c
security/keys/request_key.c
security/keys/request_key_auth.c
security/keys/user_defined.c
security/security.c

index 8963203319ea4005a4176515fce3a65f370dc1e3..3f80a684c232addd0b498241b603ba828dd7c0eb 100644 (file)
@@ -15,7 +15,7 @@
 #include <linux/ctype.h>
 #include <linux/security.h>
 #include <linux/vmalloc.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/seq_file.h>
 #include <linux/uaccess.h>
 #include <linux/mount.h>
index 18a4fdf6f6eb27d3ab56912cf68ee19e24f386a1..232db019f0519f6af292eb5db97d300856eb1bd9 100644 (file)
@@ -9,7 +9,6 @@
 
 #include <linux/capability.h>
 #include <linux/audit.h>
-#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/lsm_hooks.h>
index 8c25f949ebdb6082053c4cb8d9e89ec8d8c49e6a..77ef210a8a6b1e029ab87c0ac8db0b49ae47dba8 100644 (file)
@@ -15,7 +15,7 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/crypto.h>
 #include <linux/xattr.h>
 #include <linux/evm.h>
index 46408b9e62e876e4f711a5231ab0584aa5c7c1fd..7faf98c20373e942cb614992dc6bbe87352548d4 100644 (file)
@@ -9,7 +9,6 @@
  * the Free Software Foundation, version 2 of the License.
  */
 
-#include <linux/module.h>
 #include <linux/xattr.h>
 #include <linux/evm.h>
 
index 77de71b7794c947289832b7af0acbf07fc23ec95..015aea8fdf1e619f9592ff5cdae9bc1d80892f50 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <linux/audit.h>
 #include <linux/uaccess.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/mutex.h>
 #include "evm.h"
 
index 1ea05da2323d16275e87d2ee7bd4013dc0e7fdec..88f04b3380d4a8ce94d32fad23b7e86788d9357b 100644 (file)
@@ -16,7 +16,7 @@
  *       using a rbtree tree.
  */
 #include <linux/slab.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/spinlock.h>
 #include <linux/rbtree.h>
 #include <linux/file.h>
index 99dd1d53fc35bea0847416a7140fc46e04150efb..67dfbd1af3ca15b7e2ba1a8fa49b7f50782bf5e6 100644 (file)
@@ -12,7 +12,6 @@
  *     Implements must_appraise_or_measure, collect_measurement,
  *     appraise_measurement, store_measurement and store_template.
  */
-#include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/file.h>
 #include <linux/fs.h>
index deec1804a00aa488d02b307371cfc18475127bc3..2e11e750a06724c41185d169d8f9e8ee74f1af15 100644 (file)
@@ -8,7 +8,7 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation, version 2 of the License.
  */
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/file.h>
 #include <linux/fs.h>
 #include <linux/xattr.h>
index 3183cc23d0f8e09bbc3676910f56f6026a2903b8..0af792833f42ff22765b8cf94b53957d498df240 100644 (file)
@@ -20,7 +20,7 @@
 
 #include <linux/fcntl.h>
 #include <linux/slab.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/seq_file.h>
 #include <linux/rculist.h>
 #include <linux/rcupdate.h>
index 59d834219cd6173b3e7d2dd2858ea19e3a7d4036..6bb42a9c5e47f83b5a9b81b15fa59102ae26a29a 100644 (file)
@@ -17,7 +17,7 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/scatterlist.h>
 #include <linux/slab.h>
 #include <linux/err.h>
index 8c9499867c918bb163946679f0e0d7f57fad5dfa..3778dc396193c1200c28e52b62821b22e0cd6925 100644 (file)
@@ -10,7 +10,7 @@
  *     - initialize default measure policy rules
  *
  */
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/list.h>
 #include <linux/fs.h>
 #include <linux/security.h>
index b186819bd5aa9888d7c38ffcf255c4c23cc3d070..0e41dc1df1d4fe0e76eb2e72f538334047e83219 100644 (file)
@@ -21,7 +21,6 @@
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#include <linux/module.h>
 #include <linux/rculist.h>
 #include <linux/slab.h>
 #include "ima.h"
index cbf0bc127a7339fbd2e23183f1ed62e3c91d33fe..dc3d18cae642a327b9b5efa1b39ce0491dc8fc08 100644 (file)
@@ -15,7 +15,6 @@
  */
 
 #include <linux/uaccess.h>
-#include <linux/module.h>
 #include <linux/err.h>
 #include <keys/trusted-type.h>
 #include <keys/encrypted-type.h>
index 7207e6094dc1622c9a51beedc92288cdec244de1..634e96b380e84ef16430478b3b931421eff6b3e9 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the Licence, or (at your option) any later version.
  */
 
-#include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/security.h>
 #include <keys/keyring-type.h>
index d97c9394b5dd4f7479e9211a2dbb236503e05d2b..44a80d6741a1d66ee728e5e77880fe950a665663 100644 (file)
@@ -9,7 +9,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/init.h>
 #include <linux/poison.h>
 #include <linux/sched.h>
index 18619690ce77a926307796ec3be1626a1023db4c..e8093d025966c6dc97590a99babefd4f99cbb96a 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/sched/task.h>
index 41bcf57e96f21c5eef258b72a1b119b2fda172fd..eadebb92986ac3fa5e9e269b6bc1fc79dc64a438 100644 (file)
@@ -9,7 +9,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
index f68dc04d614e24badb3ca1058fcb023c2a54df94..06df9d5e75722857ebcba287d4af4d659b911a39 100644 (file)
@@ -9,7 +9,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/security.h>
 #include "internal.h"
 
index 5af2934965d809c4fe2d26e6b8b82641c881c968..d2b802072693d33dfd167017ffdc0f19e006c37f 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
index d5b25e535d3a5ad2ef567015bc4915d06b9f3f5e..8b89949206205e3472019fbb2e06c5708939a9bb 100644 (file)
@@ -9,7 +9,6 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/module.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/sched/user.h>
index 114f7408feee620b868801cbb53b578e7b44f615..301f0e300dbd28d1557e875e68899e133315cfbd 100644 (file)
@@ -11,7 +11,7 @@
  * See Documentation/security/keys/request-key.rst
  */
 
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/sched.h>
 #include <linux/kmod.h>
 #include <linux/err.h>
index 424e1d90412ea0c40e4e20453f47b566b0b25834..87ea2f54dedc3b2ceb72fad8a60511159d51ea3d 100644 (file)
@@ -11,7 +11,6 @@
  * See Documentation/security/keys/request-key.rst
  */
 
-#include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/err.h>
 #include <linux/seq_file.h>
index 9f558bedba23a338da5980ab11dd1b716c7b0b67..5666fe0352f776242748a1e7a7ddb19c334da09e 100644 (file)
@@ -9,7 +9,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/seq_file.h>
index 04d173eb93f6e6a493466d92a2f66e6b9790a94a..d670136dda2c9066306c7974eccb3df6fbf58ca4 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/bpf.h>
 #include <linux/capability.h>
 #include <linux/dcache.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/lsm_hooks.h>