diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index a26ae2ca96e8..7b91adbd6c08 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c @@ -163,8 +163,10 @@ static Node *get_binfmt_handler(struct linux_binprm *bprm) static void put_binfmt_handler(Node *e) { if (refcount_dec_and_test(&e->users)) { - if (e->flags & MISC_FMT_OPEN_FILE) + if (e->flags & MISC_FMT_OPEN_FILE) { + exe_file_allow_write_access(e->interp_file); filp_close(e->interp_file, NULL); + } kfree(e); } }