ima: Align ima_post_read_file() definition with LSM infrastructure

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>
This commit is contained in:
Roberto Sassu 2024-02-15 11:30:53 +01:00 committed by Paul Moore
parent 526864dd2f
commit fec5f85e46
2 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ extern int ima_post_load_data(char *buf, loff_t size,
enum kernel_load_data_id id, char *description); enum kernel_load_data_id id, char *description);
extern int ima_read_file(struct file *file, enum kernel_read_file_id id, extern int ima_read_file(struct file *file, enum kernel_read_file_id id,
bool contents); 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); enum kernel_read_file_id id);
extern void ima_post_path_mknod(struct mnt_idmap *idmap, extern void ima_post_path_mknod(struct mnt_idmap *idmap,
struct dentry *dentry); struct dentry *dentry);
@ -108,7 +108,7 @@ static inline int ima_read_file(struct file *file, enum kernel_read_file_id id,
return 0; 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) enum kernel_read_file_id id)
{ {
return 0; return 0;

View File

@ -803,7 +803,7 @@ const int read_idmap[READING_MAX_ID] = {
* On success return 0. On integrity appraisal error, assuming the file * On success return 0. On integrity appraisal error, assuming the file
* is in policy and IMA-appraisal is in enforcing mode, return -EACCES. * 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 kernel_read_file_id read_id)
{ {
enum ima_hooks func; enum ima_hooks func;