All of lore.kernel.org
 help / color / mirror / Atom feed
* drm/vc4: NULL ptr dereference during HDMI audio registration with next-20190111
@ 2019-01-12 11:24 Stefan Wahren
  2019-01-12 23:08 ` Stefan Wahren
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Wahren @ 2019-01-12 11:24 UTC (permalink / raw)
  To: Anholt, Eric, Boris Brezillon, Liam Girdwood, Mark Brown,
	paul.kocialkowski
  Cc: David Airlie, dri-devel

Hi,

kernelci.org [1] noticed a NULL pointer dereference during HDMI audio registration with linux-next-20190111 on Raspberry Pi using bcm2835_defconfig. I was able to reproduce it, but couldn't find anything suspicious in the commit ("Merge remote-tracking branch 'drm-misc-fixes/for-linux-next-fixes'") bisected by kernelci.org.

Best regards
Stefan

[1] - https://kernelci.org/boot/id/5c383ceb59b514d9ca6edd2f/

[    1.956798] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[    1.964895] pgd = (ptrval)
[    1.967682] [00000000] *pgd=00000000
[    1.971272] Internal error: Oops: 17 [#1] ARM
[    1.975623] Modules linked in:
[    1.978684] CPU: 0 PID: 70 Comm: kworker/0:2 Not tainted 5.0.0-rc1 #1
[    1.985111] Hardware name: BCM2835
[    1.988540] Workqueue: events deferred_probe_work_func
[    1.993683] PC is at strcmp+0x10/0x40
[    1.997358] LR is at soc_find_component+0x6c/0x78
[    2.002055] pc : []    lr : []    psr: 60000013
[    2.008310] sp : d9711bf0  ip : d9711c00  fp : d9711bfc
[    2.013523] r10: d975e100  r9 : d9713e20  r8 : 00000000
[    2.018738] r7 : 00000000  r6 : 00000000  r5 : c0d566b8  r4 : d9760140
[    2.025253] r3 : 00000032  r2 : 00000000  r1 : 00000000  r0 : d9759ec1
[    2.031770] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
[    2.038893] Control: 00c5387d  Table: 196c0008  DAC: 00000051
[    2.044628] Process kworker/0:2 (pid: 70, stack limit = 0x(ptrval))
[    2.050884] Stack: (0xd9711bf0 to 0xd9712000)
[    2.055239] 1be0:                                     d9711c1c d9711c00 c05b06d8 c07f78b0
[    2.063412] 1c00: d9713e20 00000000 00000000 d9713c4c d9711c44 d9711c20 c05b27b8 c05b0678
[    2.071585] 1c20: d9713c4c d9713e20 00000000 d952f810 0000008c d9713e20 d9711c6c d9711c48
[    2.079758] 1c40: c05b402c c05b2640 d975fd40 00000000 d9713c4c d952f810 d952f800 c0d45c38
[    2.087931] 1c60: d9711c8c d9711c70 c05c1190 c05b3f04 d9713c40 00000000 d952f810 d952f810
[    2.096105] 1c80: d9711cdc d9711c90 c0481e48 c05c1158 00000000 d96d37c0 d9756e80 c0d08048
[    2.104277] 1ca0: 00000000 0000000c 00000000 da68af2b d9711cdc d96d37c0 d9756e80 d952fe10
[    2.112450] 1cc0: 00000000 00000000 d9713400 006000c0 d9711d14 d9711ce0 c0489f4c c0481b80
[    2.120622] 1ce0: d952fe10 c0480224 d9711d14 d9713400 00000000 d952fe10 00000008 d96d55c0
[    2.128796] 1d00: d9759000 c0d460d0 d9711d34 d9711d18 c0479acc c0489e18 d96d37c0 d9759000
[    2.136969] 1d20: d96a580c 00000008 d9711d74 d9711d38 c04899cc c0479a48 00000018 c0232354
[    2.145142] 1d40: d952fc10 c04797e0 c0d460bc d9759000 c0d460c8 c093a284 d96d37c0 00000000
[    2.153315] 1d60: 00000000 00000000 d9711d94 d9711d78 c0489af0 c04897f0 d952fc10 00000000
[    2.161488] 1d80: c0d46070 c0d46070 d9711da4 d9711d98 c0486ef0 c0489a3c d9711dc4 d9711da8
[    2.169662] 1da0: c04921ac c0486edc d952fc10 c0e340e4 c0e340e0 c0d46070 d9711e04 d9711dc8
[    2.177836] 1dc0: c04902d0 c0492160 d9711e8c d952fc10 d952fcd8 00000007 d9711e04 d952fc10
[    2.186009] 1de0: c0d46070 c0d46070 d9711e8c 00000001 00000000 c0d46238 d9711e34 d9711e08
[    2.194183] 1e00: c04907d4 c0490088 d9711e34 d9711e18 00000001 d952fc10 c0d46070 d9711e8c
[    2.202355] 1e20: 00000001 00000000 d9711e54 d9711e38 c0490a18 c0490648 c0d08048 d9711e8c
[    2.210529] 1e40: c0490968 00000000 d9711e84 d9711e58 c048e338 c0490974 d9711e84 d94ac4dc
[    2.218703] 1e60: d96d54b4 da68af2b d952fc10 c0d46440 c0d08048 d952fc44 d9711ebc d9711e88
[    2.226876] 1e80: c0490528 c048e294 c048ad30 d952fc10 00000001 da68af2b 00000000 c0d46214
[    2.235049] 1ea0: c0d46440 d952fc10 d9c58300 00000000 d9711ecc d9711ec0 c0490a88 c0490470
[    2.243222] 1ec0: d9711eec d9711ed0 c048f268 c0490a78 c0d46214 d952fc10 c0d46228 d9c58300
[    2.251395] 1ee0: d9711f0c d9711ef0 c048f844 c048f23c d96eda80 c0d46234 c0d102c0 d9c58300
[    2.259569] 1f00: d9711f44 d9711f10 c0135388 c048f7c4 c0d175a0 c0d102d4 c0d0ff7c d96eda80
[    2.267742] 1f20: c0d102c0 c0d102c0 c0d175a0 c0d102d4 d96eda94 00000008 d9711f74 d9711f48
[    2.275915] 1f40: c013620c c01351a0 00000000 d96fd080 d96f2900 d9710000 00000000 d96eda80
[    2.284089] 1f60: c0135f80 d94e1e88 d9711fac d9711f78 c013aa00 c0135f8c d96fd098 d96fd098
[    2.292261] 1f80: d9711fac d96f2900 c013a8bc 00000000 00000000 00000000 00000000 00000000
[    2.300432] 1fa0: 00000000 d9711fb0 c01010e8 c013a8c8 00000000 00000000 00000000 00000000
[    2.308602] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    2.316773] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[    2.324930] Backtrace: 
[    2.327392] [] (strcmp) from [] (soc_find_component+0x6c/0x78)
[    2.334969] [] (soc_find_component) from [] (soc_init_dai_link+0x184/0x1f0)
[    2.343659]  r7:d9713c4c r6:00000000 r5:00000000 r4:d9713e20
[    2.349323] [] (soc_init_dai_link) from [] (snd_soc_register_card+0x134/0x180)
[    2.358276]  r9:d9713e20 r8:0000008c r7:d952f810 r6:00000000 r5:d9713e20 r4:d9713c4c
[    2.366030] [] (snd_soc_register_card) from [] (devm_snd_soc_register_card+0x44/0x78)
[    2.375591]  r9:c0d45c38 r8:d952f800 r7:d952f810 r6:d9713c4c r5:00000000 r4:d975fd40
[    2.383350] [] (devm_snd_soc_register_card) from [] (vc4_hdmi_bind+0x2d4/0x538)
[    2.392386]  r7:d952f810 r6:d952f810 r5:00000000 r4:d9713c40
[    2.398049] [] (vc4_hdmi_bind) from [] (component_bind_all+0x140/0x22c)
[    2.406396]  r10:006000c0 r9:d9713400 r8:00000000 r7:00000000 r6:d952fe10 r5:d9756e80
[    2.414209]  r4:d96d37c0
[    2.416748] [] (component_bind_all) from [] (vc4_drm_bind+0x90/0x10c)
[    2.424921]  r10:c0d460d0 r9:d9759000 r8:d96d55c0 r7:00000008 r6:d952fe10 r5:00000000
[    2.432733]  r4:d9713400
[    2.435271] [] (vc4_drm_bind) from [] (try_to_bring_up_master+0x1e8/0x24c)
[    2.443872]  r7:00000008 r6:d96a580c r5:d9759000 r4:d96d37c0
[    2.449529] [] (try_to_bring_up_master) from [] (component_add+0xc0/0x120)
[    2.458134]  r10:00000000 r9:00000000 r8:00000000 r7:d96d37c0 r6:c093a284 r5:c0d460c8
[    2.465947]  r4:d9759000
[    2.468483] [] (component_add) from [] (vc4_v3d_dev_probe+0x20/0x28)
[    2.476564]  r7:c0d46070 r6:c0d46070 r5:00000000 r4:d952fc10
[    2.482224] [] (vc4_v3d_dev_probe) from [] (platform_drv_probe+0x58/0xa4)
[    2.490751] [] (platform_drv_probe) from [] (really_probe+0x254/0x3e8)
[    2.499007]  r7:c0d46070 r6:c0e340e0 r5:c0e340e4 r4:d952fc10
[    2.504668] [] (really_probe) from [] (driver_probe_device+0x198/0x1c0)
[    2.513013]  r10:c0d46238 r9:00000000 r8:00000001 r7:d9711e8c r6:c0d46070 r5:c0d46070
[    2.520826]  r4:d952fc10
[    2.523364] [] (driver_probe_device) from [] (__device_attach_driver+0xb0/0x104)
[    2.532489]  r9:00000000 r8:00000001 r7:d9711e8c r6:c0d46070 r5:d952fc10 r4:00000001
[    2.540228] [] (__device_attach_driver) from [] (bus_for_each_drv+0xb0/0xc4)
[    2.549002]  r7:00000000 r6:c0490968 r5:d9711e8c r4:c0d08048
[    2.554661] [] (bus_for_each_drv) from [] (__device_attach+0xc4/0x15c)
[    2.562916]  r7:d952fc44 r6:c0d08048 r5:c0d46440 r4:d952fc10
[    2.568573] [] (__device_attach) from [] (device_initial_probe+0x1c/0x20)
[    2.577090]  r8:00000000 r7:d9c58300 r6:d952fc10 r5:c0d46440 r4:c0d46214
[    2.583788] [] (device_initial_probe) from [] (bus_probe_device+0x38/0x90)
[    2.592395] [] (bus_probe_device) from [] (deferred_probe_work_func+0x8c/0xb0)
[    2.601343]  r7:d9c58300 r6:c0d46228 r5:d952fc10 r4:c0d46214
[    2.607013] [] (deferred_probe_work_func) from [] (process_one_work+0x1f4/0x378)
[    2.616135]  r7:d9c58300 r6:c0d102c0 r5:c0d46234 r4:d96eda80
[    2.621795] [] (process_one_work) from [] (worker_thread+0x28c/0x404)
[    2.629968]  r10:00000008 r9:d96eda94 r8:c0d102d4 r7:c0d175a0 r6:c0d102c0 r5:c0d102c0
[    2.637781]  r4:d96eda80
[    2.640320] [] (worker_thread) from [] (kthread+0x144/0x15c)
[    2.647712]  r10:d94e1e88 r9:c0135f80 r8:d96eda80 r7:00000000 r6:d9710000 r5:d96f2900
[    2.655527]  r4:d96fd080 r3:00000000
[    2.659104] [] (kthread) from [] (ret_from_fork+0x14/0x2c)
[    2.666313] Exception stack(0xd9711fb0 to 0xd9711ff8)
[    2.671358] 1fa0:                                     00000000 00000000 00000000 00000000
[    2.679528] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    2.687696] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[    2.694307]  r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c013a8bc
[    2.702120]  r4:d96f2900
[    2.704657] Code: e1a0c00d e92dd800 e24cb004 e4d03001 (e4d12001) 
[    2.710866] ---[ end trace 5b8299805fe2083c ]---
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: drm/vc4: NULL ptr dereference during HDMI audio registration with next-20190111
  2019-01-12 11:24 drm/vc4: NULL ptr dereference during HDMI audio registration with next-20190111 Stefan Wahren
@ 2019-01-12 23:08 ` Stefan Wahren
  2019-01-14  9:09   ` Rohit Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Wahren @ 2019-01-12 23:08 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: David Airlie, Ajit Pandey, dri-devel, paul.kocialkowski,
	Boris Brezillon, Rohit kumar


> Stefan Wahren <stefan.wahren@i2se.com> hat am 12. Januar 2019 um 12:24 geschrieben:
> 
> 
> Hi,
> 
> kernelci.org [1] noticed a NULL pointer dereference during HDMI audio registration with linux-next-20190111 on Raspberry Pi using bcm2835_defconfig. I was able to reproduce it, but couldn't find anything suspicious in the commit ("Merge remote-tracking branch 'drm-misc-fixes/for-linux-next-fixes'") bisected by kernelci.org.
> 
> Best regards
> Stefan
> 
> [1] - https://kernelci.org/boot/id/5c383ceb59b514d9ca6edd2f/
> 
> [    1.956798] Unable to handle kernel NULL pointer dereference at virtual address 00000000

okay, i think i've found the responsible commit 8780cf1142a5 ("ASoC: soc-core: defer card probe until all component is added to list").

The following patch fixes the issue for me:

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 0934b36..dc6b6d1 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1134,7 +1134,8 @@ static int soc_init_dai_link(struct snd_soc_card *card,
 	 * Defer card registartion if platform dai component is not added to
 	 * component list.
 	 */
-	if (!soc_find_component(link->platform->of_node, link->platform->name))
+	if ((link->platform->of_node || link->platform->name) &&
+	    !soc_find_component(link->platform->of_node, link->platform->name))
 		return -EPROBE_DEFER;
 
 	/*
@@ -1153,7 +1154,8 @@ static int soc_init_dai_link(struct snd_soc_card *card,
 	 * Defer card registartion if cpu dai component is not added to
 	 * component list.
 	 */
-	if (!soc_find_component(link->cpu_of_node, link->cpu_name))
+	if ((link->cpu_of_node || link->cpu_name) &&
+	    !soc_find_component(link->cpu_of_node, link->cpu_name))
 		return -EPROBE_DEFER;
 
 	/*
-- 
2.7.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: drm/vc4: NULL ptr dereference during HDMI audio registration with next-20190111
  2019-01-12 23:08 ` Stefan Wahren
@ 2019-01-14  9:09   ` Rohit Kumar
  0 siblings, 0 replies; 3+ messages in thread
From: Rohit Kumar @ 2019-01-14  9:09 UTC (permalink / raw)
  To: Stefan Wahren, Mark Brown, Liam Girdwood, Pierre-Louis Bossart
  Cc: David Airlie, Ajit Pandey, dri-devel, paul.kocialkowski, Boris Brezillon


On 1/13/2019 4:38 AM, Stefan Wahren wrote:
>> Stefan Wahren <stefan.wahren@i2se.com> hat am 12. Januar 2019 um 12:24 geschrieben:
>>
>>
>> Hi,
>>
>> kernelci.org [1] noticed a NULL pointer dereference during HDMI audio registration with linux-next-20190111 on Raspberry Pi using bcm2835_defconfig. I was able to reproduce it, but couldn't find anything suspicious in the commit ("Merge remote-tracking branch 'drm-misc-fixes/for-linux-next-fixes'") bisected by kernelci.org.
>>
>> Best regards
>> Stefan
>>
>> [1] - https://kernelci.org/boot/id/5c383ceb59b514d9ca6edd2f/
>>
>> [    1.956798] Unable to handle kernel NULL pointer dereference at virtual address 00000000
> okay, i think i've found the responsible commit 8780cf1142a5 ("ASoC: soc-core: defer card probe until all component is added to list").

The fix is already posted via 
https://lore.kernel.org/patchwork/patch/1031226/.

Mark, Can you pick this up. We will still have to consider intel platform

where there is no soc_component associated with platform_name.

>
> The following patch fixes the issue for me:
>
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index 0934b36..dc6b6d1 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -1134,7 +1134,8 @@ static int soc_init_dai_link(struct snd_soc_card *card,
>   	 * Defer card registartion if platform dai component is not added to
>   	 * component list.
>   	 */
> -	if (!soc_find_component(link->platform->of_node, link->platform->name))
> +	if ((link->platform->of_node || link->platform->name) &&
> +	    !soc_find_component(link->platform->of_node, link->platform->name))
>   		return -EPROBE_DEFER;
>   
>   	/*
> @@ -1153,7 +1154,8 @@ static int soc_init_dai_link(struct snd_soc_card *card,
>   	 * Defer card registartion if cpu dai component is not added to
>   	 * component list.
>   	 */
> -	if (!soc_find_component(link->cpu_of_node, link->cpu_name))
> +	if ((link->cpu_of_node || link->cpu_name) &&
> +	    !soc_find_component(link->cpu_of_node, link->cpu_name))
>   		return -EPROBE_DEFER;
>   
>   	/*

Thanks,
Rohit
-- 
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member
of the Code Aurora Forum, hosted by the Linux Foundation.

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-14  9:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-12 11:24 drm/vc4: NULL ptr dereference during HDMI audio registration with next-20190111 Stefan Wahren
2019-01-12 23:08 ` Stefan Wahren
2019-01-14  9:09   ` Rohit Kumar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.