Skip to content

Commit

Permalink
ima: fix ima_show_template_data_ascii()
Browse files Browse the repository at this point in the history
This patch fixes a bug introduced in "4d7aeee ima: define new template
ima-ng and template fields d-ng and n-ng".

Changelog:
- change int to uint32 (Roberto Sassu's suggestion)

Signed-off-by: Mimi Zohar <[email protected]>
Signed-off-by: Roberto Sassu <[email protected]>
Cc: [email protected] # 3.13
  • Loading branch information
Mimi Zohar committed Jun 16, 2015
1 parent d6f7aa2 commit 45b2613
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion security/integrity/ima/ima.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void ima_add_violation(struct file *file, const unsigned char *filename,
const char *op, const char *cause);
int ima_init_crypto(void);
void ima_putc(struct seq_file *m, void *data, int datalen);
void ima_print_digest(struct seq_file *m, u8 *digest, int size);
void ima_print_digest(struct seq_file *m, u8 *digest, u32 size);
struct ima_template_desc *ima_template_desc_current(void);
int ima_init_template(void);

Expand Down
4 changes: 2 additions & 2 deletions security/integrity/ima/ima_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ static const struct file_operations ima_measurements_ops = {
.release = seq_release,
};

void ima_print_digest(struct seq_file *m, u8 *digest, int size)
void ima_print_digest(struct seq_file *m, u8 *digest, u32 size)
{
int i;
u32 i;

for (i = 0; i < size; i++)
seq_printf(m, "%02x", *(digest + i));
Expand Down
3 changes: 2 additions & 1 deletion security/integrity/ima/ima_template_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ static void ima_show_template_data_ascii(struct seq_file *m,
enum data_formats datafmt,
struct ima_field_data *field_data)
{
u8 *buf_ptr = field_data->data, buflen = field_data->len;
u8 *buf_ptr = field_data->data;
u32 buflen = field_data->len;

switch (datafmt) {
case DATA_FMT_DIGEST_WITH_ALGO:
Expand Down

0 comments on commit 45b2613

Please sign in to comment.