]> asedeno.scripts.mit.edu Git - linux.git/commit
xen-netback: avoid race that can lead to NULL pointer dereference
authorPaul Durrant <pdurrant@amazon.com>
Fri, 13 Dec 2019 13:20:40 +0000 (13:20 +0000)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Sun, 15 Dec 2019 19:40:15 +0000 (11:40 -0800)
commitfd42bfd1bb31f9a521be6b4f1bd89b85abc08d20
tree9bdcee15484dd3a8c51acf9a7e52c24335eb82b4
parent858ce8ca62ea1530f2779d0e3f934b0176e663c3
xen-netback: avoid race that can lead to NULL pointer dereference

In function xenvif_disconnect_queue(), the value of queue->rx_irq is
zeroed *before* queue->task is stopped. Unfortunately that task may call
notify_remote_via_irq(queue->rx_irq) and calling that function with a
zero value results in a NULL pointer dereference in evtchn_from_irq().

This patch simply re-orders things, stopping all tasks before zero-ing the
irq values, thereby avoiding the possibility of the race.

Fixes: 2ac061ce97f4 ("xen/netback: cleanup init and deinit code")
Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Acked-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
drivers/net/xen-netback/interface.c