]> git.baikalelectronics.ru Git - kernel.git/commit
fix breakage in do_rmdir()
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 12 Aug 2020 04:15:18 +0000 (05:15 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 12 Aug 2020 17:22:39 +0000 (10:22 -0700)
commite1bb2762169cae0002ddcfac88bce23beba0716e
tree91905714cf8ebad56a8d3a5e889d60d774e5e92e
parent4de45eda4041553ee2944604988276df28e7ecf9
fix breakage in do_rmdir()

syzbot reported and bisected a use-after-free due to the recent init
cleanups.

The putname() should happen only after we'd *not* branched to retry,
same as it's done in do_unlinkat().

Reported-by: syzbot+bbeb1c88016c7db4aa24@syzkaller.appspotmail.com
Fixes: fecedcb6d96d "fs: push the getname from do_rmdir into the callers"
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/namei.c