vfs: define a generic function to read a file from the kernel
authorMimi Zohar <zohar@linux.vnet.ibm.com>
Mon, 28 Dec 2015 21:02:29 +0000 (16:02 -0500)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Thu, 18 Feb 2016 22:14:03 +0000 (17:14 -0500)
commitb44a7dfc6fa16e01f2497c9fa62c3926f94be174
treeb48ced5b7c84986778ca4ac3b6bf3f13c74f2ef2
parent4b2530d819e179ae3352c38a1ceff929a922d070
vfs: define a generic function to read a file from the kernel

For a while it was looked down upon to directly read files from Linux.
These days there exists a few mechanisms in the kernel that do just
this though to load a file into a local buffer.  There are minor but
important checks differences on each.  This patch set is the first
attempt at resolving some of these differences.

This patch introduces a common function for reading files from the kernel
with the corresponding security post-read hook and function.

Changelog v4+:
- export security_kernel_post_read_file() - Fengguang Wu
v3:
- additional bounds checking - Luis
v2:
- To simplify patch review, re-ordered patches

Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Reviewed-by: Luis R. Rodriguez <mcgrof@suse.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
fs/exec.c
include/linux/fs.h
include/linux/lsm_hooks.h
include/linux/security.h
security/security.c
This page took 0.027569 seconds and 5 git commands to generate.