]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
xen-netback: take a reference to the RX task thread
authorRoger Pau Monne <roger.pau@citrix.com>
Mon, 7 Jun 2021 13:13:15 +0000 (15:13 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 30 Jun 2021 06:27:59 +0000 (08:27 +0200)
commit89bd4a8ecaecf3823f3658f39f6fd3885e449ab9
tree872b43b453322e2707360246d3a2ff0af4fd3dc2
parent2f8bc514956518ab99206e5e6477c62465dbf8bb
xen-netback: take a reference to the RX task thread

BugLink: https://bugs.launchpad.net/bugs/1933691
commit 107866a8eb0b664675a260f1ba0655010fac1e08 upstream.

Do this in order to prevent the task from being freed if the thread
returns (which can be triggered by the frontend) before the call to
kthread_stop done as part of the backend tear down. Not taking the
reference will lead to a use-after-free in that scenario. Such
reference was taken before but dropped as part of the rework done in
2ac061ce97f4.

Reintroduce the reference taking and add a comment this time
explaining why it's needed.

This is XSA-374 / CVE-2021-28691.

Fixes: 2ac061ce97f4 ('xen/netback: cleanup init and deinit code')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: stable@vger.kernel.org
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/net/xen-netback/interface.c