diff mbox series

[3/3] ima: Append line feed to ima/binary_runtime_measurements

Message ID 20220505132301.124832-4-wangweiyang2@huawei.com (mailing list archive)
State New, archived
Headers show
Series Append line feed to files in securityfs | expand

Commit Message

Wang Weiyang May 5, 2022, 1:23 p.m. UTC
There is no LF in binary_runtime_measurements output. It is little weird,
so append LF to it.

Example:

/ # cat /sys/kernel/security/ima/binary_runtime_measurements
...imaboot_aggregate/ #

Signed-off-by: Wang Weiyang <wangweiyang2@huawei.com>
---
 security/integrity/ima/ima_fs.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Mimi Zohar May 6, 2022, 11:16 a.m. UTC | #1
On Thu, 2022-05-05 at 21:23 +0800, Wang Weiyang wrote:
> There is no LF in binary_runtime_measurements output. It is little weird,
> so append LF to it.
> 
> Example:
> 
> / # cat /sys/kernel/security/ima/binary_runtime_measurements
> ...imaboot_aggregate/ #

Why would you cat a binary file?!.  Doesn't make sense.

Mimi

> 
> Signed-off-by: Wang Weiyang <wangweiyang2@huawei.com>
Wang Weiyang May 6, 2022, 12:31 p.m. UTC | #2
Hi Mimi,

Sorry I didn't think thoroughly. Just ignore this patch.

Thanks.

在 2022/5/6 19:16, Mimi Zohar 写道:
> On Thu, 2022-05-05 at 21:23 +0800, Wang Weiyang wrote:
>> There is no LF in binary_runtime_measurements output. It is little weird,
>> so append LF to it.
>>
>> Example:
>>
>> / # cat /sys/kernel/security/ima/binary_runtime_measurements
>> ...imaboot_aggregate/ #
> 
> Why would you cat a binary file?!.  Doesn't make sense.
> 
> Mimi
> 
>>
>> Signed-off-by: Wang Weiyang <wangweiyang2@huawei.com>
> 
> .
>
diff mbox series

Patch

diff --git a/security/integrity/ima/ima_fs.c b/security/integrity/ima/ima_fs.c
index cd1683dad3bf..0a2f9cb25b20 100644
--- a/security/integrity/ima/ima_fs.c
+++ b/security/integrity/ima/ima_fs.c
@@ -183,6 +183,7 @@  int ima_measurements_show(struct seq_file *m, void *v)
 			show = IMA_SHOW_BINARY_OLD_STRING_FMT;
 		field->field_show(m, show, &e->template_data[i]);
 	}
+	seq_puts(m, "\n");
 	return 0;
 }