Skip to content

Commit

Permalink
Merge branch 'next-integrity.logging-cleanup' into next-integrity
Browse files Browse the repository at this point in the history
From the cover-letter:

The log messages from integrity subsystem should be consistent for better
diagnosability and discoverability.

This patch set improves the logging by removing duplicate log formatting
macros, adding a consistent prefix to the log messages, and adding new
log messages where necessary.
  • Loading branch information
mimizohar committed Feb 28, 2020
2 parents f8788d8 + 555d6d7 commit 96c8217
Show file tree
Hide file tree
Showing 18 changed files with 12 additions and 34 deletions.
2 changes: 0 additions & 2 deletions security/integrity/digsig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 0 additions & 2 deletions security/integrity/digsig_asymmetric.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 0 additions & 2 deletions security/integrity/evm/evm_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 0 additions & 2 deletions security/integrity/evm/evm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 0 additions & 2 deletions security/integrity/evm/evm_secfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 3 additions & 3 deletions security/integrity/ima/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ ima-y := ima_fs.o ima_queue.o ima_init.o ima_main.o ima_crypto.o ima_api.o \
ima-$(CONFIG_IMA_APPRAISE) += ima_appraise.o
ima-$(CONFIG_IMA_APPRAISE_MODSIG) += ima_modsig.o
ima-$(CONFIG_HAVE_IMA_KEXEC) += ima_kexec.o
obj-$(CONFIG_IMA_BLACKLIST_KEYRING) += ima_mok.o
obj-$(CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS) += ima_asymmetric_keys.o
obj-$(CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS) += ima_queue_keys.o
ima-$(CONFIG_IMA_BLACKLIST_KEYRING) += ima_mok.o
ima-$(CONFIG_IMA_MEASURE_ASYMMETRIC_KEYS) += ima_asymmetric_keys.o
ima-$(CONFIG_IMA_QUEUE_EARLY_BOOT_KEYS) += ima_queue_keys.o
2 changes: 0 additions & 2 deletions security/integrity/ima/ima_asymmetric_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
* create or update.
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <keys/asymmetric-type.h>
#include "ima.h"

Expand Down
2 changes: 0 additions & 2 deletions security/integrity/ima/ima_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 0 additions & 2 deletions security/integrity/ima/ima_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 0 additions & 2 deletions security/integrity/ima/ima_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
1 change: 0 additions & 1 deletion security/integrity/ima/ima_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
5 changes: 3 additions & 2 deletions security/integrity/ima/ima_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -757,6 +755,9 @@ void process_buffer_measurement(const void *buf, int size,
ima_free_template_entry(entry);

out:
if (ret < 0)
pr_devel("%s: failed, result: %d\n", __func__, ret);

return;
}

Expand Down
2 changes: 0 additions & 2 deletions security/integrity/ima/ima_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 0 additions & 2 deletions security/integrity/ima/ima_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions security/integrity/ima/ima_queue_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions security/integrity/ima/ima_template.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions security/integrity/ima/ima_template_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions security/integrity/integrity.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 96c8217

Please sign in to comment.