deal with deadlock in d_walk() 80/154380/1
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 26 Oct 2014 23:31:10 +0000 (19:31 -0400)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Tue, 10 Oct 2017 06:48:32 +0000 (15:48 +0900)
commitb76a4122928d6ee52fed51a0bf97ec6bd49d2add
tree7741cc0e1067daa642232e698ee402bb0a7a17ca
parent987256a1341fa8ca5311dca1da192660239bed0f
deal with deadlock in d_walk()

commit ca5358ef75fc69fee5322a38a340f5739d997c10 upstream.

... by not hitting rename_retry for reasons other than rename having
happened.  In other words, do _not_ restart when finding that
between unlocking the child and locking the parent the former got
into __dentry_kill().  Skip the killed siblings instead...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Ben Hutchings <ben@decadent.org.uk>
[hujianyang: Backported to 3.10 refer to the work of Ben Hutchings in 3.2:
 - As we only have try_to_ascend() and not d_walk(), apply this
   change to all callers of try_to_ascend()
 - Adjust context to make __dentry_kill() apply to d_kill()]
Signed-off-by: hujianyang <hujianyang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[sw0312.kim: cherry-pick from linux-3.10.y to fix CVE-2014-8559]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I9965aad4c4add2e35f2e3ab2b71cc4e9712bba1e
fs/dcache.c