Skip to content

Commit e3f20ae

Browse files
author
Al Viro
committed
security_file_open(): lose cred argument
Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent ae2bb29 commit e3f20ae

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

‎fs/open.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ static int do_dentry_open(struct file *f,
776776
goto cleanup_all;
777777
}
778778

779-
error = security_file_open(f, f->f_cred);
779+
error = security_file_open(f);
780780
if (error)
781781
goto cleanup_all;
782782

‎include/linux/security.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ void security_file_set_fowner(struct file *file);
309309
int security_file_send_sigiotask(struct task_struct *tsk,
310310
struct fown_struct *fown, int sig);
311311
int security_file_receive(struct file *file);
312-
int security_file_open(struct file *file, const struct cred *cred);
312+
int security_file_open(struct file *file);
313313
int security_task_alloc(struct task_struct *task, unsigned long clone_flags);
314314
void security_task_free(struct task_struct *task);
315315
int security_cred_alloc_blank(struct cred *cred, gfp_t gfp);
@@ -858,8 +858,7 @@ static inline int security_file_receive(struct file *file)
858858
return 0;
859859
}
860860

861-
static inline int security_file_open(struct file *file,
862-
const struct cred *cred)
861+
static inline int security_file_open(struct file *file)
863862
{
864863
return 0;
865864
}

‎security/security.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -970,11 +970,11 @@ int security_file_receive(struct file *file)
970970
return call_int_hook(file_receive, 0, file);
971971
}
972972

973-
int security_file_open(struct file *file, const struct cred *cred)
973+
int security_file_open(struct file *file)
974974
{
975975
int ret;
976976

977-
ret = call_int_hook(file_open, 0, file, cred);
977+
ret = call_int_hook(file_open, 0, file, file->f_cred);
978978
if (ret)
979979
return ret;
980980

0 commit comments

Comments
 (0)