Oleg Nesterov 83f918274e exec: binfmt_misc: shift filp_close(interp_file) from kill_node() to bm_evict_inode()
To ensure that load_misc_binary() can't use the partially destroyed
Node, see also the next patch.

The current logic looks wrong in any case, once we close interp_file it
doesn't make any sense to delay kfree(inode->i_private), this Node is no
longer valid.  Even if the MISC_FMT_OPEN_FILE/interp_file checks were
not racy (they are), load_misc_binary() should not try to reopen
->interpreter if MISC_FMT_OPEN_FILE is set but ->interp_file is NULL.

And I can't understand why do we use filp_close(), not fput().

Link: http://lkml.kernel.org/r/20170922143644.GA17216@redhat.com
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Kees Cook <keescook@chromium.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Ben Woodard <woodard@redhat.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jim Foraker <foraker1@llnl.gov>
Cc: <tdhooge@llnl.gov>
Cc: Travis Gummels <tgummels@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-10-03 17:54:25 -07:00
..
2017-09-04 19:05:15 -04:00
2017-08-24 13:23:03 -07:00
2017-09-12 20:05:58 -07:00
2017-09-18 12:24:26 +02:00
2017-09-11 22:01:44 -07:00
2017-09-14 20:04:32 -07:00
2017-07-06 03:31:46 -04:00
2017-09-08 19:33:25 -07:00
2017-09-04 19:05:15 -04:00
2017-04-17 12:52:27 -04:00
2017-09-28 13:27:23 -07:00
2016-12-14 23:48:11 -05:00
2017-06-22 11:44:55 -04:00
2017-07-06 03:27:09 -04:00
2017-07-06 03:27:09 -04:00
2017-05-08 17:15:12 -07:00
2017-08-17 22:06:03 +02:00
2017-09-03 20:24:30 -04:00