diff mbox series

[3/3,v5] call ima_kexec_cmdline from kexec_file_load path

Message ID 20190510223744.10154-4-prsriva02@gmail.com (mailing list archive)
State New, archived
Headers show
Series Kexec cmdline bufffer measure | expand

Commit Message

Prakhar Srivastava May 10, 2019, 10:37 p.m. UTC
From: Prakhar Srivastava <prsriva02@gmail.com>

To measure the cmldine args used in case of soft reboot. Call the 
ima hook defined in [PATCH 1/3 v5]:"add a new ima hook and policy to measure the cmdline"

Signed-off-by: Prakhar Srivastava <prsriva02@gmail.com>
---
 kernel/kexec_file.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Mimi Zohar May 14, 2019, 2:46 p.m. UTC | #1
[Cc'ing Dave Young]

On Fri, 2019-05-10 at 15:37 -0700, Prakhar Srivastava wrote:
> From: Prakhar Srivastava <prsriva02@gmail.com>

The "From" line above should only appear when the patch author and the
sender differ.  You can create the patches under one id and post them
from another id.  Something is still wrong.

> 
> To measure the cmldine args used in case of soft reboot. Call the 
> ima hook defined in [PATCH 1/3 v5]:"add a new ima hook and policy to measure the cmdline"
> 
> Signed-off-by: Prakhar Srivastava <prsriva02@gmail.com>

> ---
>  kernel/kexec_file.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
> index f1d0e00a3971..e779bcf674a0 100644
> --- a/kernel/kexec_file.c
> +++ b/kernel/kexec_file.c
> @@ -241,6 +241,8 @@ kimage_file_prepare_segments(struct kimage *image, int kernel_fd, int initrd_fd,
>  			ret = -EINVAL;
>  			goto out;
>  		}
> +
> +		ima_kexec_cmdline(image->cmdline_buf, image->cmdline_buf_len - 1);
>  	}
>  
>  	/* Call arch image load handlers */

Much better!

Mimi
diff mbox series

Patch

diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
index f1d0e00a3971..e779bcf674a0 100644
--- a/kernel/kexec_file.c
+++ b/kernel/kexec_file.c
@@ -241,6 +241,8 @@  kimage_file_prepare_segments(struct kimage *image, int kernel_fd, int initrd_fd,
 			ret = -EINVAL;
 			goto out;
 		}
+
+		ima_kexec_cmdline(image->cmdline_buf, image->cmdline_buf_len - 1);
 	}
 
 	/* Call arch image load handlers */