integrity: Remove duplicate pr_fmt definitions
authorTushar Sugandhi <tusharsu@linux.microsoft.com>
Wed, 19 Feb 2020 00:06:11 +0000 (16:06 -0800)
committerMimi Zohar <zohar@linux.ibm.com>
Fri, 28 Feb 2020 19:32:58 +0000 (14:32 -0500)
The #define for formatting log messages, pr_fmt, is duplicated in the
files under security/integrity.

This change moves the definition to security/integrity/integrity.h and
removes the duplicate definitions in the other files under
security/integrity.

With this change, the messages in the following files will be prefixed
with 'integrity'.

     security/integrity/platform_certs/platform_keyring.c
     security/integrity/platform_certs/load_powerpc.c
     security/integrity/platform_certs/load_uefi.c
     security/integrity/iint.c

     e.g. "integrity: Error adding keys to platform keyring %s\n"

And the messages in the following file will be prefixed with 'ima'.

     security/integrity/ima/ima_mok.c

     e.g. "ima: Allocating IMA blacklist keyring.\n"

For the rest of the files under security/integrity, there will be no
change in the message format.

Suggested-by: Shuah Khan <skhan@linuxfoundation.org>
Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Tushar Sugandhi <tusharsu@linux.microsoft.com>
Reviewed-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
17 files changed:
security/integrity/digsig.c
security/integrity/digsig_asymmetric.c
security/integrity/evm/evm_crypto.c
security/integrity/evm/evm_main.c
security/integrity/evm/evm_secfs.c
security/integrity/ima/ima_asymmetric_keys.c
security/integrity/ima/ima_crypto.c
security/integrity/ima/ima_fs.c
security/integrity/ima/ima_init.c
security/integrity/ima/ima_kexec.c
security/integrity/ima/ima_main.c
security/integrity/ima/ima_policy.c
security/integrity/ima/ima_queue.c
security/integrity/ima/ima_queue_keys.c
security/integrity/ima/ima_template.c
security/integrity/ima/ima_template_lib.c
security/integrity/integrity.h

index ea1aae3d07b3cb083a0e2e4e939e0d502acdd914..e9cbadade74bda5e046457895212a71b1e97c78b 100644 (file)
@@ -6,8 +6,6 @@
  * Dmitry Kasatkin <dmitry.kasatkin@intel.com>
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/err.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
index 55aec161d0e1c9e73cda8fab91ca5442065162d2..4e0d6778277ebc9c51e9c9ce7de56c0fa8ac9e54 100644 (file)
@@ -6,8 +6,6 @@
  * Dmitry Kasatkin <dmitry.kasatkin@intel.com>
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/err.h>
 #include <linux/ratelimit.h>
 #include <linux/key-type.h>
index d485f6fc908e50bc5857c39a51ade369a9cfedad..35682852ddea94d5a09bbe19020b2460950665b6 100644 (file)
@@ -10,8 +10,6 @@
  *      Using root's kernel master key (kmk), calculate the HMAC
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/export.h>
 #include <linux/crypto.h>
 #include <linux/xattr.h>
index f9a81b187fae9d1a8aea498cf790f5a08d306c35..d361d7fdafc49f11215e52e7f27fc9d6549671fb 100644 (file)
@@ -11,8 +11,6 @@
  *     evm_inode_removexattr, and evm_verifyxattr
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/init.h>
 #include <linux/crypto.h>
 #include <linux/audit.h>
index c11c1f7b3ddd15fde49a3afdfb1e4499a39acbc4..39ad1038d45dad4f06d84c16fdb169384400b007 100644 (file)
@@ -10,8 +10,6 @@
  *     - Get the key and enable EVM
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/audit.h>
 #include <linux/uaccess.h>
 #include <linux/init.h>
index 7678f0e3e84d10fcae92253da9200655bfdc2840..aaae80c4e376bff477ca9e879bc0bde0e5d43c48 100644 (file)
@@ -9,8 +9,6 @@
  *       create or update.
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <keys/asymmetric-type.h>
 #include "ima.h"
 
index 7967a69048517e14c85e78a986d42cff5d7d372f..423c84f95a141bc1f88decff38c7cddea9465f99 100644 (file)
@@ -10,8 +10,6 @@
  *     Calculates md5/sha1 file hash, template hash, boot-aggreate hash
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/kernel.h>
 #include <linux/moduleparam.h>
 #include <linux/ratelimit.h>
index 2000e8df0301b8730a49124d38bf857583310934..a71e822a6e92d4d8feeb3957cbc48f1f1fe82660 100644 (file)
@@ -12,8 +12,6 @@
  *     current measurement list and IMA statistics
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/fcntl.h>
 #include <linux/slab.h>
 #include <linux/init.h>
index 195cb4079b2b5d78e367cf562ecd60c7b409bd22..567468188a61d67b7e7e6378ade7744bab0f4cdf 100644 (file)
@@ -11,8 +11,6 @@
  *             initialization and cleanup functions
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/init.h>
 #include <linux/scatterlist.h>
 #include <linux/slab.h>
index 9e94eca48b898b6f2057d5da3f0dfb8008699358..121de3e04af2316a05e3713cee2501fe9bb0fd18 100644 (file)
@@ -6,7 +6,6 @@
  * Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
  * Mimi Zohar <zohar@linux.vnet.ibm.com>
  */
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/seq_file.h>
 #include <linux/vmalloc.h>
index aac1c44fb11b73196c74bca4346a85d7214edba3..9d0abedeae77ad4da89716f9dfc483d14a0f8df2 100644 (file)
@@ -15,8 +15,6 @@
  *     and ima_file_check.
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/module.h>
 #include <linux/file.h>
 #include <linux/binfmts.h>
index 453427048999eea55ea80fe55505a92b0cc1aceb..c334e0dc60831c8383e4f4611066681938840fd5 100644 (file)
@@ -7,8 +7,6 @@
  *     - initialize default measure policy rules
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/init.h>
 #include <linux/list.h>
 #include <linux/fs.h>
index 1ce8b1701566fa8764c986463c27febcc8cb2d44..8753212ddb18aaf14bf54d4473625b43aeefbb04 100644 (file)
@@ -15,8 +15,6 @@
  *       ever removed or changed during the boot-cycle.
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/rculist.h>
 #include <linux/slab.h>
 #include "ima.h"
index c87c72299191f2e8cd208374b26d6886c5a0f075..cb3e3f5015936904d41e71b901f2c0c20f9380d5 100644 (file)
@@ -8,8 +8,6 @@
  *       Enables deferred processing of keys
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/workqueue.h>
 #include <keys/asymmetric-type.h>
 #include "ima.h"
index 6aa6408603e33e3e6665bdfe6b84a9862cde5a29..062d9ad49afb623a699107b925ffd3ae0f7a09da 100644 (file)
@@ -9,8 +9,6 @@
  *      Helpers to manage template descriptors.
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/rculist.h>
 #include "ima.h"
 #include "ima_template_lib.h"
index 32ae05d8825735000e8d00a5669ba0ff9559415a..9cd1e50f3ccc7521ad84b94d0fb05b7c3d74d353 100644 (file)
@@ -9,8 +9,6 @@
  *      Library of supported template fields.
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include "ima_template_lib.h"
 
 static bool ima_template_hash_algo_allowed(u8 algo)
index 73fc286834d7bc368914d3f8056da80d80d975bc..298b73794d8b1cf3d7a6b371abe81131adc319b7 100644 (file)
@@ -6,6 +6,12 @@
  * Mimi Zohar <zohar@us.ibm.com>
  */
 
+#ifdef pr_fmt
+#undef pr_fmt
+#endif
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/types.h>
 #include <linux/integrity.h>
 #include <crypto/sha.h>