linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Macpaul Lin <macpaul.lin@mediatek.com>,
	Chunfeng Yun <chunfeng.yun@mediatek.com>
Subject: [PATCH 5.4 77/85] usb: mtu3: fix panic in mtu3_gadget_stop()
Date: Mon,  9 Nov 2020 13:56:14 +0100	[thread overview]
Message-ID: <20201109125026.277312774@linuxfoundation.org> (raw)
In-Reply-To: <20201109125022.614792961@linuxfoundation.org>

From: Macpaul Lin <macpaul.lin@mediatek.com>

commit 20914919ad31849ee2b9cfe0428f4a20335c9e2a upstream.

This patch fixes a possible issue when mtu3_gadget_stop()
already assigned NULL to mtu->gadget_driver during mtu_gadget_disconnect().

[<ffffff9008161974>] notifier_call_chain+0xa4/0x128
[<ffffff9008161fd4>] __atomic_notifier_call_chain+0x84/0x138
[<ffffff9008162ec0>] notify_die+0xb0/0x120
[<ffffff900809e340>] die+0x1f8/0x5d0
[<ffffff90080d03b4>] __do_kernel_fault+0x19c/0x280
[<ffffff90080d04dc>] do_bad_area+0x44/0x140
[<ffffff90080d0f9c>] do_translation_fault+0x4c/0x90
[<ffffff9008080a78>] do_mem_abort+0xb8/0x258
[<ffffff90080849d0>] el1_da+0x24/0x3c
[<ffffff9009bde01c>] mtu3_gadget_disconnect+0xac/0x128
[<ffffff9009bd576c>] mtu3_irq+0x34c/0xc18
[<ffffff90082ac03c>] __handle_irq_event_percpu+0x2ac/0xcd0
[<ffffff90082acae0>] handle_irq_event_percpu+0x80/0x138
[<ffffff90082acc44>] handle_irq_event+0xac/0x148
[<ffffff90082b71cc>] handle_fasteoi_irq+0x234/0x568
[<ffffff90082a8708>] generic_handle_irq+0x48/0x68
[<ffffff90082a96ac>] __handle_domain_irq+0x264/0x1740
[<ffffff90080819f4>] gic_handle_irq+0x14c/0x250
[<ffffff9008084cec>] el1_irq+0xec/0x194
[<ffffff90085b985c>] dma_pool_alloc+0x6e4/0xae0
[<ffffff9008d7f890>] cmdq_mbox_pool_alloc_impl+0xb0/0x238
[<ffffff9008d80904>] cmdq_pkt_alloc_buf+0x2dc/0x7c0
[<ffffff9008d80f60>] cmdq_pkt_add_cmd_buffer+0x178/0x270
[<ffffff9008d82320>] cmdq_pkt_perf_begin+0x108/0x148
[<ffffff9008d824d8>] cmdq_pkt_create+0x178/0x1f0
[<ffffff9008f96230>] mtk_crtc_config_default_path+0x328/0x7a0
[<ffffff90090246cc>] mtk_drm_idlemgr_kick+0xa6c/0x1460
[<ffffff9008f9bbb4>] mtk_drm_crtc_atomic_begin+0x1a4/0x1a68
[<ffffff9008e8df9c>] drm_atomic_helper_commit_planes+0x154/0x878
[<ffffff9008f2fb70>] mtk_atomic_complete.isra.16+0xe80/0x19c8
[<ffffff9008f30910>] mtk_atomic_commit+0x258/0x898
[<ffffff9008ef142c>] drm_atomic_commit+0xcc/0x108
[<ffffff9008ef7cf0>] drm_mode_atomic_ioctl+0x1c20/0x2580
[<ffffff9008ebc768>] drm_ioctl_kernel+0x118/0x1b0
[<ffffff9008ebcde8>] drm_ioctl+0x5c0/0x920
[<ffffff900863b030>] do_vfs_ioctl+0x188/0x1820
[<ffffff900863c754>] SyS_ioctl+0x8c/0xa0

Fixes: df2069acb005 ("usb: Add MediaTek USB3 DRD driver")
Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
Acked-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/1604642069-20961-1-git-send-email-macpaul.lin@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/usb/mtu3/mtu3_gadget.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/usb/mtu3/mtu3_gadget.c
+++ b/drivers/usb/mtu3/mtu3_gadget.c
@@ -587,6 +587,7 @@ static int mtu3_gadget_stop(struct usb_g
 
 	spin_unlock_irqrestore(&mtu->lock, flags);
 
+	synchronize_irq(mtu->irq);
 	return 0;
 }
 



  parent reply	other threads:[~2020-11-09 13:15 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-09 12:54 [PATCH 5.4 00/85] 5.4.76-rc1 review Greg Kroah-Hartman
2020-11-09 12:54 ` [PATCH 5.4 01/85] drm/i915: Break up error capture compression loops with cond_resched() Greg Kroah-Hartman
2020-11-09 12:54 ` [PATCH 5.4 02/85] drm/i915/gt: Delay execlist processing for tgl Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 03/85] drm/i915: Drop runtime-pm assert from vgpu io accessors Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 04/85] ASoC: Intel: Skylake: Add alternative topology binary name Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 05/85] linkage: Introduce new macros for assembler symbols Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 06/85] arm64: asm: Add new-style position independent function annotations Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 07/85] arm64: lib: Use modern annotations for assembly functions Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 08/85] arm64: Change .weak to SYM_FUNC_START_WEAK_PI for arch/arm64/lib/mem*.S Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 09/85] tipc: fix use-after-free in tipc_bcast_get_mode Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 10/85] ptrace: fix task_join_group_stop() for the case when current is traced Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 11/85] cadence: force nonlinear buffers to be cloned Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 12/85] chelsio/chtls: fix memory leaks caused by a race Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 13/85] chelsio/chtls: fix always leaking ctrl_skb Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 14/85] gianfar: Replace skb_realloc_headroom with skb_cow_head for PTP Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 15/85] gianfar: Account for Tx PTP timestamp in the skb headroom Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 16/85] ionic: check port ptr before use Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 17/85] ip_tunnel: fix over-mtu packet send fail without TUNNEL_DONT_FRAGMENT flags Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 18/85] net: usb: qmi_wwan: add Telit LE910Cx 0x1230 composition Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 19/85] powerpc/vnic: Extend "failover pending" window Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 20/85] sctp: Fix COMM_LOST/CANT_STR_ASSOC err reporting on big-endian platforms Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 21/85] sfp: Fix error handing in sfp_probe() Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 22/85] Fonts: Replace discarded const qualifier Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 23/85] ALSA: hda/realtek - Fixed HP headset Mic cant be detected Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 24/85] ALSA: hda/realtek - Enable headphone for ASUS TM420 Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 25/85] ALSA: usb-audio: Add implicit feedback quirk for Zoom UAC-2 Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 26/85] ALSA: usb-audio: add usb vendor id as DSD-capable for Khadas devices Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 27/85] ALSA: usb-audio: Add implicit feedback quirk for Qu-16 Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 28/85] ALSA: usb-audio: Add implicit feedback quirk for MODX Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 29/85] mm: mempolicy: fix potential pte_unmap_unlock pte error Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 30/85] lib/crc32test: remove extra local_irq_disable/enable Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 31/85] kthread_worker: prevent queuing delayed work from timer_fn when it is being canceled Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 32/85] mm: always have io_remap_pfn_range() set pgprot_decrypted() Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 33/85] gfs2: Wake up when sd_glock_disposal becomes zero Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 34/85] ring-buffer: Fix recursion protection transitions between interrupt context Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 35/85] mtd: spi-nor: Dont copy self-pointing struct around Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 36/85] ftrace: Fix recursion check for NMI test Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 37/85] ftrace: Handle tracing when switching between context Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 38/85] regulator: defer probe when trying to get voltage from unresolved supply Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 39/85] spi: bcm2835: fix gpio cs level inversion Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 40/85] tracing: Fix out of bounds write in get_trace_buf Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 41/85] futex: Handle transient "ownerless" rtmutex state correctly Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 42/85] ARM: dts: sun4i-a10: fix cpu_alert temperature Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 43/85] arm64: dts: meson: add missing g12 rng clock Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 44/85] x86/kexec: Use up-to-dated screen_info copy to fill boot params Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 45/85] of: Fix reserved-memory overlap detection Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 46/85] drm/sun4i: frontend: Rework a bit the phase data Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 47/85] drm/sun4i: frontend: Reuse the ch0 phase for RGB formats Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 48/85] drm/sun4i: frontend: Fix the scaler phase on A33 Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 49/85] blk-cgroup: Fix memleak on error path Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 50/85] blk-cgroup: Pre-allocate tree node on blkg_conf_prep Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 51/85] scsi: core: Dont start concurrent async scan on same host Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 52/85] drm/amdgpu: add DID for navi10 blockchain SKU Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 53/85] scsi: ibmvscsi: Fix potential race after loss of transport Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 54/85] vsock: use ns_capable_noaudit() on socket create Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 55/85] nvme-rdma: handle unexpected nvme completion data length Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 56/85] nvmet: fix a NULL pointer dereference when tracing the flush command Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 57/85] drm/vc4: drv: Add error handding for bind Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 58/85] ACPI: NFIT: Fix comparison to -ENXIO Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 59/85] usb: cdns3: gadget: suspicious implicit sign extension Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 60/85] drm/nouveau/nouveau: fix the start/end range for migration Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 61/85] drm/nouveau/gem: fix "refcount_t: underflow; use-after-free" Greg Kroah-Hartman
2020-11-09 12:55 ` [PATCH 5.4 62/85] arm64/smp: Move rcu_cpu_starting() earlier Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 63/85] Revert "coresight: Make sysfs functional on topologies with per core sink" Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 64/85] vt: Disable KD_FONT_OP_COPY Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 65/85] fork: fix copy_process(CLONE_PARENT) race with the exiting ->real_parent Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 66/85] s390/pkey: fix paes selftest failure with paes and pkey static build Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 67/85] serial: 8250_mtk: Fix uart_get_baud_rate warning Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 68/85] serial: txx9: add missing platform_driver_unregister() on error in serial_txx9_init Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 69/85] USB: serial: cyberjack: fix write-URB completion race Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 70/85] USB: serial: option: add Quectel EC200T module support Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 71/85] USB: serial: option: add LE910Cx compositions 0x1203, 0x1230, 0x1231 Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 72/85] USB: serial: option: add Telit FN980 composition 0x1055 Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 73/85] tty: serial: fsl_lpuart: add LS1028A support Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 74/85] tty: serial: fsl_lpuart: LS1021A has a FIFO size of 16 words, like LS1028A Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 75/85] usb: dwc3: ep0: Fix delay status handling Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 76/85] USB: Add NO_LPM quirk for Kingston flash drive Greg Kroah-Hartman
2020-11-09 12:56 ` Greg Kroah-Hartman [this message]
2020-11-09 12:56 ` [PATCH 5.4 78/85] drm/panfrost: Fix a deadlock between the shrinker and madvise path Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 79/85] ARC: stack unwinding: avoid indefinite looping Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 80/85] PM: runtime: Drop runtime PM references to supplier on link removal Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 81/85] PM: runtime: Drop pm_runtime_clean_up_links() Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 82/85] PM: runtime: Resume the device earlier in __device_release_driver() Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 83/85] xfs: flush for older, xfs specific ioctls Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 84/85] perf/core: Fix a memory leak in perf_event_parse_addr_filter() Greg Kroah-Hartman
2020-11-09 12:56 ` [PATCH 5.4 85/85] arm64: dts: marvell: espressobin: Add ethernet switch aliases Greg Kroah-Hartman
2020-11-09 23:05 ` [PATCH 5.4 00/85] 5.4.76-rc1 review Guenter Roeck
2020-11-09 23:22 ` Shuah Khan
2020-11-10  4:14 ` Naresh Kamboju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201109125026.277312774@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=chunfeng.yun@mediatek.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macpaul.lin@mediatek.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).