FAILED: patch "[PATCH] net: tun: stop NAPI when detaching queues" failed to apply to 4.14-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From a8fc8cb5692aebb9c6f7afd4265366d25dcd1d01 Mon Sep 17 00:00:00 2001
From: Jakub Kicinski <[email protected]>
Date: Wed, 22 Jun 2022 21:21:05 -0700
Subject: [PATCH] net: tun: stop NAPI when detaching queues
While looking at a syzbot report I noticed the NAPI only gets disabled before it's deleted. I think that user can detach the queue before destroying the device and the NAPI will never be stopped.
drivers/net/tun.c +10 -1
@@ -273,6 +273,12 @@ static void tun_napi_init(struct tun_struct *tun, struct tun_file *tfile, } } +static void tun_napi_enable (struct tun_file *tfile) +{ +if (tfile->napi_enabled) +napi_enable (&tfile->napi); +} +static void tun_napi_disable (struct tun_file *tfile) {if (tfile->napi_enabled)
@@ -653,8 +659,10 @@ static void __tun_detach(struct tun_file *tfile, bool clean)if (clean) {RCU_INIT_POINTER (tfile->tun,NULL );sock_put (&tfile->sk); - }else + }else {tun_disable_queue (tun, tfile); +tun_napi_disable (tfile); + }synchronize_net ();tun_flow_delete_by_queue (tun, tun->numqueues +1 );
@@ -808,6 +816,7 @@ static int tun_attach(struct tun_struct *tun, struct file *file,if (tfile->detached) {tun_enable_queue (tfile); +tun_napi_enable (tfile); }else {sock_hold (&tfile->sk);tun_napi_init (tun, tfile, napi, napi_frags);
Greg KH
maintainerQuoted 5 lines · On Mon, Jul 04, 2022 at 01:35:42PM +0200, [email protected] wrote:
The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
Oops, nevermind, this is not supposed to go to 4.14.y, sorry for the noise.
greg k-h