Message ID | 20180918133434.27437-2-amir73il@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Assorted overlayfs fixes for 4.19-rc5 | expand |
On Tue, Sep 18, 2018 at 04:34:31PM +0300, Amir Goldstein wrote: > Fixes: caf70cb2ba5d ("ovl: cleanup orphan index entries") > Cc: <stable@vger.kernel.org> # v4.13 > Signed-off-by: Amir Goldstein <amir73il@gmail.com> > --- > fs/overlayfs/util.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) I know I reject patches without any changelog text present. Maybe Miklos is more forgiving than me... :) greg k-h
On Tue, Sep 18, 2018 at 4:59 PM Greg KH <gregkh@linuxfoundation.org> wrote: > > On Tue, Sep 18, 2018 at 04:34:31PM +0300, Amir Goldstein wrote: > > Fixes: caf70cb2ba5d ("ovl: cleanup orphan index entries") > > Cc: <stable@vger.kernel.org> # v4.13 > > Signed-off-by: Amir Goldstein <amir73il@gmail.com> > > --- > > fs/overlayfs/util.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > I know I reject patches without any changelog text present. Maybe > Miklos is more forgiving than me... :) > Well, I did not intend to CC stable at this point, but since I did and since you chimed in, Miklos, feel free to add to commit message: The memory leak was detected by kmemleak when running xfstests overlay/051,053 Thanks, Amir.
diff --git a/fs/overlayfs/util.c b/fs/overlayfs/util.c index 8cfb62cc8672..ace4fe4c39a9 100644 --- a/fs/overlayfs/util.c +++ b/fs/overlayfs/util.c @@ -683,7 +683,7 @@ static void ovl_cleanup_index(struct dentry *dentry) struct dentry *upperdentry = ovl_dentry_upper(dentry); struct dentry *index = NULL; struct inode *inode; - struct qstr name; + struct qstr name = { }; int err; err = ovl_get_index_name(lowerdentry, &name); @@ -726,6 +726,7 @@ static void ovl_cleanup_index(struct dentry *dentry) goto fail; out: + kfree(name.name); dput(index); return;
Fixes: caf70cb2ba5d ("ovl: cleanup orphan index entries") Cc: <stable@vger.kernel.org> # v4.13 Signed-off-by: Amir Goldstein <amir73il@gmail.com> --- fs/overlayfs/util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)