]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: fix dentry leak upon mkdir failure.
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Mon, 12 Aug 2019 02:16:11 +0000 (11:16 +0900)
committerJ. Bruce Fields <bfields@redhat.com>
Thu, 15 Aug 2019 18:53:00 +0000 (14:53 -0400)
commit7115cb1ee0862ea524d00f65b6039f6b37e8489c
tree6a25ba0ff6a531dff603b34e1f5c92c727210a06
parentbfe2de5a355e71917b08e947fe3e805ec2f51c71
nfsd: fix dentry leak upon mkdir failure.

syzbot is reporting that nfsd_mkdir() forgot to remove dentry created by
d_alloc_name() when __nfsd_mkdir() failed (due to memory allocation fault
injection) [1].

[1] https://syzkaller.appspot.com/bug?id=ce41a1f769ea4637ebffedf004a803e8405b4674

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reported-by: syzbot <syzbot+2c95195d5d433f6ed6cb@syzkaller.appspotmail.com>
Fixes: b8d5d6507640581b ("nfsd: add nfsd/clients directory")
[bfields: clean up in nfsd_mkdir instead of __nfsd_mkdir]
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfsctl.c