Commit 089bc8e9 authored by Dmitry Kasatkin's avatar Dmitry Kasatkin Committed by Mimi Zohar

ima: fix script messages

Fix checkpatch, lindent, etc, warnings/errors
Signed-off-by: default avatarDmitry Kasatkin <d.kasatkin@samsung.com>
Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
parent 4ef4c943
...@@ -28,7 +28,7 @@ static const char *keyring_name[INTEGRITY_KEYRING_MAX] = { ...@@ -28,7 +28,7 @@ static const char *keyring_name[INTEGRITY_KEYRING_MAX] = {
}; };
int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen, int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen,
const char *digest, int digestlen) const char *digest, int digestlen)
{ {
if (id >= INTEGRITY_KEYRING_MAX) if (id >= INTEGRITY_KEYRING_MAX)
return -EINVAL; return -EINVAL;
......
...@@ -11,8 +11,9 @@ ...@@ -11,8 +11,9 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/xattr.h> #include <linux/xattr.h>
#include <linux/evm.h>
int posix_xattr_acl(char *xattr) int posix_xattr_acl(const char *xattr)
{ {
int xattr_len = strlen(xattr); int xattr_len = strlen(xattr);
......
...@@ -55,7 +55,7 @@ static int ima_fix_xattr(struct dentry *dentry, ...@@ -55,7 +55,7 @@ static int ima_fix_xattr(struct dentry *dentry,
enum integrity_status ima_get_cache_status(struct integrity_iint_cache *iint, enum integrity_status ima_get_cache_status(struct integrity_iint_cache *iint,
int func) int func)
{ {
switch(func) { switch (func) {
case MMAP_CHECK: case MMAP_CHECK:
return iint->ima_mmap_status; return iint->ima_mmap_status;
case BPRM_CHECK: case BPRM_CHECK:
...@@ -71,7 +71,7 @@ enum integrity_status ima_get_cache_status(struct integrity_iint_cache *iint, ...@@ -71,7 +71,7 @@ enum integrity_status ima_get_cache_status(struct integrity_iint_cache *iint,
static void ima_set_cache_status(struct integrity_iint_cache *iint, static void ima_set_cache_status(struct integrity_iint_cache *iint,
int func, enum integrity_status status) int func, enum integrity_status status)
{ {
switch(func) { switch (func) {
case MMAP_CHECK: case MMAP_CHECK:
iint->ima_mmap_status = status; iint->ima_mmap_status = status;
break; break;
...@@ -90,7 +90,7 @@ static void ima_set_cache_status(struct integrity_iint_cache *iint, ...@@ -90,7 +90,7 @@ static void ima_set_cache_status(struct integrity_iint_cache *iint,
static void ima_cache_flags(struct integrity_iint_cache *iint, int func) static void ima_cache_flags(struct integrity_iint_cache *iint, int func)
{ {
switch(func) { switch (func) {
case MMAP_CHECK: case MMAP_CHECK:
iint->flags |= (IMA_MMAP_APPRAISED | IMA_APPRAISED); iint->flags |= (IMA_MMAP_APPRAISED | IMA_APPRAISED);
break; break;
......
...@@ -88,8 +88,7 @@ static void *ima_measurements_next(struct seq_file *m, void *v, loff_t *pos) ...@@ -88,8 +88,7 @@ static void *ima_measurements_next(struct seq_file *m, void *v, loff_t *pos)
* against concurrent list-extension * against concurrent list-extension
*/ */
rcu_read_lock(); rcu_read_lock();
qe = list_entry_rcu(qe->later.next, qe = list_entry_rcu(qe->later.next, struct ima_queue_entry, later);
struct ima_queue_entry, later);
rcu_read_unlock(); rcu_read_unlock();
(*pos)++; (*pos)++;
......
...@@ -244,9 +244,9 @@ int ima_file_mmap(struct file *file, unsigned long prot) ...@@ -244,9 +244,9 @@ int ima_file_mmap(struct file *file, unsigned long prot)
int ima_bprm_check(struct linux_binprm *bprm) int ima_bprm_check(struct linux_binprm *bprm)
{ {
return process_measurement(bprm->file, return process_measurement(bprm->file,
(strcmp(bprm->filename, bprm->interp) == 0) ? (strcmp(bprm->filename, bprm->interp) == 0) ?
bprm->filename : bprm->interp, bprm->filename : bprm->interp,
MAY_EXEC, BPRM_CHECK); MAY_EXEC, BPRM_CHECK);
} }
/** /**
...@@ -263,8 +263,8 @@ int ima_file_check(struct file *file, int mask) ...@@ -263,8 +263,8 @@ int ima_file_check(struct file *file, int mask)
{ {
ima_rdwr_violation_check(file); ima_rdwr_violation_check(file);
return process_measurement(file, NULL, return process_measurement(file, NULL,
mask & (MAY_READ | MAY_WRITE | MAY_EXEC), mask & (MAY_READ | MAY_WRITE | MAY_EXEC),
FILE_CHECK); FILE_CHECK);
} }
EXPORT_SYMBOL_GPL(ima_file_check); EXPORT_SYMBOL_GPL(ima_file_check);
......
...@@ -89,7 +89,7 @@ struct integrity_iint_cache *integrity_iint_find(struct inode *inode); ...@@ -89,7 +89,7 @@ struct integrity_iint_cache *integrity_iint_find(struct inode *inode);
#ifdef CONFIG_INTEGRITY_SIGNATURE #ifdef CONFIG_INTEGRITY_SIGNATURE
int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen, int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen,
const char *digest, int digestlen); const char *digest, int digestlen);
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment