]> git.baikalelectronics.ru Git - 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)
committerJuergen Gross <jgross@suse.com>
Mon, 7 Jun 2021 13:13:15 +0000 (15:13 +0200)
commitf3642963823b4a5edb782eab73ad92ca7afc4137
tree8c48f10e20935f1d7bf2c725a5f053690db745ba
parent49f8e1b78782055ba295b100fbc2462e09853eb7
xen-netback: take a reference to the RX task thread

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
0db6f2f75ccb.

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

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

Fixes: 0db6f2f75ccb ('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>
drivers/net/xen-netback/interface.c