Message ID | 20200812041518.GO1236603@ZenIV.linux.org.uk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Re: KASAN: use-after-free Read in path_init (2) | expand |
On Tue, Aug 11, 2020 at 9:15 PM Al Viro <viro@zeniv.linux.org.uk> wrote: > > fix breakage in do_rmdir() > > putname() should happen only after we'd *not* branched to > retry, same as it's done in do_unlinkat(). Looks obviously correct. Do you want me to apply directly, or do you have other fixes pending and I'll get a pull request? Linus
On Tue, Aug 11, 2020 at 09:29:47PM -0700, Linus Torvalds wrote: > On Tue, Aug 11, 2020 at 9:15 PM Al Viro <viro@zeniv.linux.org.uk> wrote: > > > > fix breakage in do_rmdir() > > > > putname() should happen only after we'd *not* branched to > > retry, same as it's done in do_unlinkat(). > > Looks obviously correct. > > Do you want me to apply directly, or do you have other fixes pending > and I'll get a pull request? Not at the moment - I can throw it into #fixes and send a pull request if you wish, but there won't be anything else in it...
On Tue, Aug 11, 2020 at 10:56 PM Al Viro <viro@zeniv.linux.org.uk> wrote: > > On Tue, Aug 11, 2020 at 09:29:47PM -0700, Linus Torvalds wrote: > > > > Do you want me to apply directly, or do you have other fixes pending > > and I'll get a pull request? > > Not at the moment - I can throw it into #fixes and send a pull request > if you wish, but there won't be anything else in it... Ok, I applied the patch directly. Thanks, Linus
diff --git a/fs/namei.c b/fs/namei.c index fde8fe086c09..9fa10c614de7 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -3770,11 +3770,11 @@ long do_rmdir(int dfd, struct filename *name) mnt_drop_write(path.mnt); exit1: path_put(&path); - putname(name); if (retry_estale(error, lookup_flags)) { lookup_flags |= LOOKUP_REVAL; goto retry; } + putname(name); return error; }