]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
netfilter: fix a use-after-free in mtype_destroy()
authorCong Wang <xiyou.wangcong@gmail.com>
Fri, 10 Jan 2020 19:53:08 +0000 (11:53 -0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commit48556d5731d0c1ba0fe4d53bed646677b04e90ed
treea2a4da4bf712cbea20b8b21d5784e99f69eb33a3
parentf55083fe4642638573c9451f347b161f52819d7f
netfilter: fix a use-after-free in mtype_destroy()

BugLink: https://bugs.launchpad.net/bugs/1862259
commit c120959387efa51479056fd01dc90adfba7a590c upstream.

map->members is freed by ip_set_free() right before using it in
mtype_ext_cleanup() again. So we just have to move it down.

Reported-by: syzbot+4c3cc6dbe7259dbf9054@syzkaller.appspotmail.com
Fixes: 40cd63bf33b2 ("netfilter: ipset: Support extensions which need a per data destroy function")
Acked-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
net/netfilter/ipset/ip_set_bitmap_gen.h