mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-07-01 23:53:16 -04:00
security: define new LSM hook named security_kernel_load_data
Differentiate between the kernel reading a file specified by userspace from the kernel loading a buffer containing data provided by userspace. This patch defines a new LSM hook named security_kernel_load_data(). Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com> Cc: Eric Biederman <ebiederm@xmission.com> Cc: Luis R. Rodriguez <mcgrof@kernel.org> Cc: Kees Cook <keescook@chromium.org> Cc: Casey Schaufler <casey@schaufler-ca.com> Acked-by: Serge Hallyn <serge@hallyn.com> Acked-by: Kees Cook <keescook@chromium.org> Signed-off-by: James Morris <james.morris@microsoft.com>
This commit is contained in:
parent
57b54d74dd
commit
377179cd28
3 changed files with 38 additions and 0 deletions
|
@ -576,6 +576,10 @@
|
|||
* userspace to load a kernel module with the given name.
|
||||
* @kmod_name name of the module requested by the kernel
|
||||
* Return 0 if successful.
|
||||
* @kernel_load_data:
|
||||
* Load data provided by userspace.
|
||||
* @id kernel load data identifier
|
||||
* Return 0 if permission is granted.
|
||||
* @kernel_read_file:
|
||||
* Read a file specified by userspace.
|
||||
* @file contains the file structure pointing to the file being read
|
||||
|
@ -1582,6 +1586,7 @@ union security_list_options {
|
|||
int (*kernel_act_as)(struct cred *new, u32 secid);
|
||||
int (*kernel_create_files_as)(struct cred *new, struct inode *inode);
|
||||
int (*kernel_module_request)(char *kmod_name);
|
||||
int (*kernel_load_data)(enum kernel_load_data_id id);
|
||||
int (*kernel_read_file)(struct file *file, enum kernel_read_file_id id);
|
||||
int (*kernel_post_read_file)(struct file *file, char *buf, loff_t size,
|
||||
enum kernel_read_file_id id);
|
||||
|
@ -1872,6 +1877,7 @@ struct security_hook_heads {
|
|||
struct hlist_head cred_getsecid;
|
||||
struct hlist_head kernel_act_as;
|
||||
struct hlist_head kernel_create_files_as;
|
||||
struct hlist_head kernel_load_data;
|
||||
struct hlist_head kernel_read_file;
|
||||
struct hlist_head kernel_post_read_file;
|
||||
struct hlist_head kernel_module_request;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue