]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ovl: fix oopses in ovl_fill_super() failure paths
authorMiklos Szeredi <mszeredi@redhat.com>
Mon, 10 Sep 2018 09:43:29 +0000 (11:43 +0200)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:49:40 +0000 (19:49 -0600)
commit6b93b50f3356dd1146f5c43c1fe7d30b03555d86
treef68d8ab724a852b84b6d6bcdabd9374d710a00d0
parent9489c7cec5b497b47def09813e0648a87da2b563
ovl: fix oopses in ovl_fill_super() failure paths

BugLink: https://bugs.launchpad.net/bugs/1836117
commit 8c25741aaad8be6fbe51510e917c740e0059cf83 upstream.

ovl_free_fs() dereferences ofs->workbasedir and ofs->upper_mnt in cases when
those might not have been initialized yet.

Fix the initialization order for these fields.

Reported-by: syzbot+c75f181dc8429d2eb887@syzkaller.appspotmail.com
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Cc: <stable@vger.kernel.org> # v4.15
Fixes: 95e6d4177cb7 ("ovl: grab reference to workbasedir early")
Fixes: a9075cdb467d ("ovl: factor out ovl_free_fs() helper")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
fs/overlayfs/super.c