]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ima: Align ima_post_read_file() definition with LSM infrastructure
authorRoberto Sassu <roberto.sassu@huawei.com>
Thu, 15 Feb 2024 10:30:53 +0000 (11:30 +0100)
committerPaul Moore <paul@paul-moore.com>
Fri, 16 Feb 2024 04:43:40 +0000 (23:43 -0500)
Change ima_post_read_file() definition, by making "void *buf" a
"char *buf", so that it can be registered as implementation of the
post_read_file hook.

Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Reviewed-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Reviewed-by: Casey Schaufler <casey@schaufler-ca.com>
Acked-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
include/linux/ima.h
security/integrity/ima/ima_main.c

index 678a03fddd7e4277c2f83631b118526488a077b2..31ef6c3c32077427fae6420c4f80143cd8b72865 100644 (file)
@@ -30,7 +30,7 @@ extern int ima_post_load_data(char *buf, loff_t size,
                              enum kernel_load_data_id id, char *description);
 extern int ima_read_file(struct file *file, enum kernel_read_file_id id,
                         bool contents);
-extern int ima_post_read_file(struct file *file, void *buf, loff_t size,
+extern int ima_post_read_file(struct file *file, char *buf, loff_t size,
                              enum kernel_read_file_id id);
 extern void ima_post_path_mknod(struct mnt_idmap *idmap,
                                struct dentry *dentry);
@@ -108,7 +108,7 @@ static inline int ima_read_file(struct file *file, enum kernel_read_file_id id,
        return 0;
 }
 
-static inline int ima_post_read_file(struct file *file, void *buf, loff_t size,
+static inline int ima_post_read_file(struct file *file, char *buf, loff_t size,
                                     enum kernel_read_file_id id)
 {
        return 0;
index b3f5e8401056481ee5f04bbbca37bfdfd243add8..02021ee467d3db6f41087bbe0da0336803ed1d5e 100644 (file)
@@ -803,7 +803,7 @@ const int read_idmap[READING_MAX_ID] = {
  * On success return 0.  On integrity appraisal error, assuming the file
  * is in policy and IMA-appraisal is in enforcing mode, return -EACCES.
  */
-int ima_post_read_file(struct file *file, void *buf, loff_t size,
+int ima_post_read_file(struct file *file, char *buf, loff_t size,
                       enum kernel_read_file_id read_id)
 {
        enum ima_hooks func;