kexec: replace call to copy_file_from_fd() with kernel version
authorMimi Zohar <zohar@linux.vnet.ibm.com>
Fri, 15 Jan 2016 01:59:14 +0000 (20:59 -0500)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Sun, 21 Feb 2016 14:06:14 +0000 (09:06 -0500)
commitb804defe4297157a9ff45863769efe9a01953398
tree562c479b3b93e922ac99a0afe94d09015e3cf11d
parentc6af8efe97d87fa308eb1bbd0cf4feb820a4d622
kexec: replace call to copy_file_from_fd() with kernel version

Replace copy_file_from_fd() with kernel_read_file_from_fd().

Two new identifiers named READING_KEXEC_IMAGE and READING_KEXEC_INITRAMFS
are defined for measuring, appraising or auditing the kexec image and
initramfs.

Changelog v3:
- return -EBADF, not -ENOEXEC
- identifier change
- split patch, moving copy_file_from_fd() to a separate patch
- split patch, moving IMA changes to a separate patch
v0:
- use kstat file size type loff_t, not size_t
- Calculate the file hash from the in memory buffer - Dave Young

Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Luis R. Rodriguez <mcgrof@kernel.org>
Cc: Eric Biederman <ebiederm@xmission.com>
Acked-by: Dave Young <dyoung@redhat.com>
include/linux/fs.h
kernel/kexec_file.c