]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: gadget: ether: Fix race between gether_disconnect and rx_submit
authorKiruthika Varadarajan <Kiruthika.Varadarajan@harman.com>
Tue, 18 Jun 2019 08:39:06 +0000 (08:39 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 Jul 2019 06:09:49 +0000 (08:09 +0200)
commit43b417e412f10d7a9dee7b519904d4c619072320
treeadb2e08bf7dba89e1db251f324b60290b1a15067
parent5b5a979c8fb2d5d85789c577478762d6d5c99fe9
usb: gadget: ether: Fix race between gether_disconnect and rx_submit

commit d29fcf7078bc8be2b6366cbd4418265b53c94fac upstream.

On spin lock release in rx_submit, gether_disconnect get a chance to
run, it makes port_usb NULL, rx_submit access NULL port USB, hence null
pointer crash.

Fixed by releasing the lock in rx_submit after port_usb is used.

Fixes: 2b3d942c4878 ("usb ethernet gadget: split out network core")
Cc: <stable@vger.kernel.org>
Signed-off-by: Kiruthika Varadarajan <Kiruthika.Varadarajan@harman.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/function/u_ether.c