Revision 1a07a94b47b1f528f39c3e6187b5eaf02efe44ea authored by Ondrej Jirman on 05 April 2019, 23:30:48 UTC, committed by Maxime Ripard on 08 April 2019, 08:30:23 UTC
There are two problems here:

1. Not all clk_data->hws[] need to be initialized, depending on various
   configured quirks. This leads to NULL ptr deref in
   clk_hw_unregister_gate() in sun8i_tcon_top_unbind()
2. If there is error when registering the clk_data->hws[],
   err_unregister_gates error path will try to unregister
   IS_ERR()=true (invalid) pointer.

For problem (1) I have this stack trace:

Unable to handle kernel NULL pointer dereference at virtual
  address 0000000000000008
Call trace:
 clk_hw_unregister+0x8/0x18
 clk_hw_unregister_gate+0x14/0x28
 sun8i_tcon_top_unbind+0x2c/0x60
 component_unbind.isra.4+0x2c/0x50
 component_bind_all+0x1d4/0x230
 sun4i_drv_bind+0xc4/0x1a0
 try_to_bring_up_master+0x164/0x1c0
 __component_add+0xa0/0x168
 component_add+0x10/0x18
 sun8i_dw_hdmi_probe+0x18/0x20
 platform_drv_probe+0x3c/0x70
 really_probe+0xcc/0x278
 driver_probe_device+0x34/0xa8

Problem (2) was identified by head scratching.

Signed-off-by: Ondrej Jirman <megous@megous.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190405233048.3823-1-megous@megous.com
1 parent b85d00b
History
File Mode Size
bpfilter
netfilter
Kconfig -rw-r--r-- 25.6 KB
Makefile -rw-r--r-- 2.8 KB
af_inet.c -rw-r--r-- 50.8 KB
ah4.c -rw-r--r-- 13.6 KB
arp.c -rw-r--r-- 35.8 KB
cipso_ipv4.c -rw-r--r-- 61.7 KB
datagram.c -rw-r--r-- 3.2 KB
devinet.c -rw-r--r-- 66.9 KB
esp4.c -rw-r--r-- 23.8 KB
esp4_offload.c -rw-r--r-- 6.4 KB
fib_frontend.c -rw-r--r-- 36.5 KB
fib_lookup.h -rw-r--r-- 1.5 KB
fib_notifier.c -rw-r--r-- 1.6 KB
fib_rules.c -rw-r--r-- 9.7 KB
fib_semantics.c -rw-r--r-- 42.4 KB
fib_trie.c -rw-r--r-- 66.6 KB
fou.c -rw-r--r-- 25.3 KB
gre_demux.c -rw-r--r-- 4.9 KB
gre_offload.c -rw-r--r-- 7.0 KB
icmp.c -rw-r--r-- 29.7 KB
igmp.c -rw-r--r-- 73.0 KB
inet_connection_sock.c -rw-r--r-- 30.8 KB
inet_diag.c -rw-r--r-- 31.5 KB
inet_fragment.c -rw-r--r-- 13.0 KB
inet_hashtables.c -rw-r--r-- 21.3 KB
inet_timewait_sock.c -rw-r--r-- 8.8 KB
inetpeer.c -rw-r--r-- 8.3 KB
ip_forward.c -rw-r--r-- 4.1 KB
ip_fragment.c -rw-r--r-- 17.8 KB
ip_gre.c -rw-r--r-- 43.2 KB
ip_input.c -rw-r--r-- 17.3 KB
ip_options.c -rw-r--r-- 15.3 KB
ip_output.c -rw-r--r-- 40.2 KB
ip_sockglue.c -rw-r--r-- 36.9 KB
ip_tunnel.c -rw-r--r-- 30.2 KB
ip_tunnel_core.c -rw-r--r-- 12.5 KB
ip_vti.c -rw-r--r-- 16.2 KB
ipcomp.c -rw-r--r-- 4.6 KB
ipconfig.c -rw-r--r-- 42.0 KB
ipip.c -rw-r--r-- 18.7 KB
ipmr.c -rw-r--r-- 76.1 KB
ipmr_base.c -rw-r--r-- 10.0 KB
metrics.c -rw-r--r-- 2.1 KB
netfilter.c -rw-r--r-- 2.5 KB
netlink.c -rw-r--r-- 696 bytes
ping.c -rw-r--r-- 28.0 KB
proc.c -rw-r--r-- 19.9 KB
protocol.c -rw-r--r-- 2.3 KB
raw.c -rw-r--r-- 26.9 KB
raw_diag.c -rw-r--r-- 6.4 KB
route.c -rw-r--r-- 80.3 KB
syncookies.c -rw-r--r-- 11.8 KB
sysctl_net_ipv4.c -rw-r--r-- 32.1 KB
tcp.c -rw-r--r-- 102.9 KB
tcp_bbr.c -rw-r--r-- 40.8 KB
tcp_bic.c -rw-r--r-- 5.9 KB
tcp_bpf.c -rw-r--r-- 15.6 KB
tcp_cdg.c -rw-r--r-- 11.1 KB
tcp_cong.c -rw-r--r-- 11.5 KB
tcp_cubic.c -rw-r--r-- 14.5 KB
tcp_dctcp.c -rw-r--r-- 7.6 KB
tcp_dctcp.h -rw-r--r-- 1.0 KB
tcp_diag.c -rw-r--r-- 4.6 KB
tcp_fastopen.c -rw-r--r-- 15.4 KB
tcp_highspeed.c -rw-r--r-- 4.9 KB
tcp_htcp.c -rw-r--r-- 7.4 KB
tcp_hybla.c -rw-r--r-- 4.9 KB
tcp_illinois.c -rw-r--r-- 8.3 KB
tcp_input.c -rw-r--r-- 186.2 KB
tcp_ipv4.c -rw-r--r-- 70.7 KB
tcp_lp.c -rw-r--r-- 8.8 KB
tcp_metrics.c -rw-r--r-- 26.8 KB
tcp_minisocks.c -rw-r--r-- 25.9 KB
tcp_nv.c -rw-r--r-- 15.6 KB
tcp_offload.c -rw-r--r-- 8.3 KB
tcp_output.c -rw-r--r-- 109.1 KB
tcp_rate.c -rw-r--r-- 7.8 KB
tcp_recovery.c -rw-r--r-- 7.9 KB
tcp_scalable.c -rw-r--r-- 1.4 KB
tcp_timer.c -rw-r--r-- 21.7 KB
tcp_ulp.c -rw-r--r-- 3.0 KB
tcp_vegas.c -rw-r--r-- 9.6 KB
tcp_vegas.h -rw-r--r-- 940 bytes
tcp_veno.c -rw-r--r-- 5.7 KB
tcp_westwood.c -rw-r--r-- 8.2 KB
tcp_yeah.c -rw-r--r-- 6.9 KB
tunnel4.c -rw-r--r-- 5.5 KB
udp.c -rw-r--r-- 77.5 KB
udp_diag.c -rw-r--r-- 7.5 KB
udp_impl.h -rw-r--r-- 1.2 KB
udp_offload.c -rw-r--r-- 14.6 KB
udp_tunnel.c -rw-r--r-- 5.6 KB
udplite.c -rw-r--r-- 3.2 KB
xfrm4_input.c -rw-r--r-- 4.3 KB
xfrm4_mode_beet.c -rw-r--r-- 3.7 KB
xfrm4_mode_transport.c -rw-r--r-- 3.1 KB
xfrm4_mode_tunnel.c -rw-r--r-- 3.8 KB
xfrm4_output.c -rw-r--r-- 2.7 KB
xfrm4_policy.c -rw-r--r-- 8.6 KB
xfrm4_protocol.c -rw-r--r-- 6.7 KB
xfrm4_state.c -rw-r--r-- 2.4 KB
xfrm4_tunnel.c -rw-r--r-- 2.7 KB

back to top