Return-path: Received: from gosford.compton.nu ([217.169.17.27]:40889 "EHLO gosford.compton.nu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751073AbbF0QLW (ORCPT ); Sat, 27 Jun 2015 12:11:22 -0400 Received: from bericote.compton.nu ([2001:8b0:bd:1:1881:14ff:fe46:3cc7]:52162 ident=tom) by bericote.compton.nu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.85) (envelope-from ) id 1Z8s7W-0000ZN-7x for linux-wireless@vger.kernel.org; Sat, 27 Jun 2015 16:34:18 +0100 To: linux-wireless@vger.kernel.org From: Tom Hughes Subject: Null pointer dereference when station associates Message-ID: <558EC27A.60804@compton.nu> (sfid-20150627_181129_907073_7F8F41EE) Date: Sat, 27 Jun 2015 16:34:18 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Sender: linux-wireless-owner@vger.kernel.org List-ID: I am encountering null pointer dereference when a station associates with my Fedora 22 box which is running as an access point. Wireless card is: 02:00.0 Network controller: Qualcomm Atheros AR928X Wireless Network Adapter (PCI-Express) (rev 01) Subsystem: Qualcomm Atheros Device 3099 Kernel driver in use: ath9k Kernel modules: ath9k relevant software: hostapd-2.4-2.fc22.i686 kernel-PAE-core-4.0.4-301.fc22.i686 kernel-PAE-core-4.0.5-300.fc22.i686 The machine had been running under the 4.0.4 kernel for about a month until it hit this error yesterday. Rebooting it came up in 4.0.5 and each time it hit the error almost immediately. Going back to 4.0.4 it has been stable so far. The actual trace, from the 4.0.5 kernel is: Jun 26 14:51:00 gosford.compton.nu hostapd[820]: wlp2s0: STA cc:fa:00:aa:4e:59 IEEE 802.11: authentication OK (open system) Jun 26 14:51:00 gosford.compton.nu hostapd[820]: wlp2s0: STA cc:fa:00:aa:4e:59 MLME: MLME-AUTHENTICATE.indication(cc:fa:00:aa:4e:59, OPEN_SYSTEM) Jun 26 14:51:00 gosford.compton.nu hostapd[820]: wlp2s0: STA cc:fa:00:aa:4e:59 MLME: MLME-DELETEKEYS.request(cc:fa:00:aa:4e:59) Jun 26 14:51:00 gosford.compton.nu hostapd[820]: wlp2s0: STA cc:fa:00:aa:4e:59 IEEE 802.11: authenticated Jun 26 14:51:00 gosford.compton.nu hostapd[820]: wlp2s0: STA cc:fa:00:aa:4e:59 IEEE 802.11: association OK (aid 1) Jun 26 14:51:00 gosford.compton.nu hostapd[820]: wlp2s0: STA cc:fa:00:aa:4e:59 IEEE 802.11: associated (aid 1) Jun 26 14:51:00 gosford.compton.nu hostapd[820]: wlp2s0: STA cc:fa:00:aa:4e:59 MLME: MLME-ASSOCIATE.indication(cc:fa:00:aa:4e:59) Jun 26 14:51:00 gosford.compton.nu hostapd[820]: wlp2s0: STA cc:fa:00:aa:4e:59 MLME: MLME-DELETEKEYS.request(cc:fa:00:aa:4e:59) Jun 26 14:51:00 gosford.compton.nu kernel: BUG: unable to handle kernel NULL pointer dereference at 0000006c Jun 26 14:51:00 gosford.compton.nu kernel: IP: [] mutex_lock+0x12/0x30 Jun 26 14:51:00 gosford.compton.nu kernel: *pdpt = 0000000034070001 *pde = 0000000000000000 Jun 26 14:51:00 gosford.compton.nu kernel: Oops: 0002 [#1] SMP Jun 26 14:51:00 gosford.compton.nu kernel: Modules linked in: 8021q garp mrp pppoe pppox ppp_generic slhc ip6t_REJECT nf_nat_ftp nf_reject_ipv6 nf_conntrack_ftp nf_log_ipv4 nf_conntrack_ipv6 nf_defrag_ipv6 ipt_MASQUERADE nf_log_ipv6 nf Jun 26 14:51:00 gosford.compton.nu kernel: CPU: 1 PID: 820 Comm: hostapd Not tainted 4.0.5-300.fc22.i686+PAE #1 Jun 26 14:51:00 gosford.compton.nu kernel: Hardware name: /D945GSEJT , BIOS JT94510H.86A.0025.2009.0306.1639 03/06/2009 Jun 26 14:51:00 gosford.compton.nu kernel: task: f6a2c080 ti: f41c2000 task.ti: f41c2000 Jun 26 14:51:00 gosford.compton.nu kernel: EIP: 0060:[] EFLAGS: 00210286 CPU: 1 Jun 26 14:51:00 gosford.compton.nu kernel: EIP is at mutex_lock+0x12/0x30 Jun 26 14:51:00 gosford.compton.nu kernel: EAX: 0000006c EBX: 0000006c ECX: c0f66a68 EDX: 80000000 Jun 26 14:51:00 gosford.compton.nu kernel: ESI: f41c3716 EDI: f3e843e0 EBP: f41c36b4 ESP: f41c36b0 Jun 26 14:51:00 gosford.compton.nu kernel: DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068 Jun 26 14:51:00 gosford.compton.nu kernel: CR0: 80050033 CR2: 0000006c CR3: 34102000 CR4: 000007f0 Jun 26 14:51:00 gosford.compton.nu kernel: Stack: Jun 26 14:51:00 gosford.compton.nu kernel: f47e1000 f41c36d0 c0678ab4 00000012 f41c3728 00000002 f3aa5000 f73a2540 Jun 26 14:51:00 gosford.compton.nu kernel: f41c36f0 c0679203 f3aa5000 f73a2540 f3e843e0 f3aa5000 f73a2540 f3e843e0 Jun 26 14:51:00 gosford.compton.nu kernel: f41c3738 f8a938ae f41c3716 00000012 f8ab0237 f3aa5620 00000001 f41c3716 Jun 26 14:51:00 gosford.compton.nu kernel: Call Trace: Jun 26 14:51:01 gosford.compton.nu kernel: [] start_creating+0x44/0xc0 Jun 26 14:51:01 gosford.compton.nu kernel: [] debugfs_create_dir+0x13/0xf0 Jun 26 14:51:01 gosford.compton.nu kernel: [] ieee80211_sta_debugfs_add+0x6e/0x490 [mac80211] Jun 26 14:51:01 gosford.compton.nu kernel: [] ? ath9k_del_ps_key.isra.18+0x70/0x70 [ath9k] Jun 26 14:51:01 gosford.compton.nu kernel: [] sta_info_insert_finish+0x514/0x830 [mac80211] Jun 26 14:51:01 gosford.compton.nu kernel: [] ? __enqueue_entity+0x6d/0x80 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? native_smp_send_reschedule+0x3f/0x60 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? resched_curr+0x68/0xb0 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? ath_buf_set_rate+0x362/0x410 [ath9k] Jun 26 14:51:01 gosford.compton.nu kernel: [] ? update_curr+0x5e/0x190 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? sched_slice.isra.50+0x4a/0xb0 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? __update_cpu_load+0xc7/0x100 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? scheduler_tick+0x86/0xc0 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? ktime_get+0x4a/0x120 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? lapic_next_event+0x1b/0x20 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? clockevents_program_event+0x8d/0x140 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? tick_program_event+0x29/0x30 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? hrtimer_interrupt+0x11d/0x280 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? irq_exit+0x6e/0xb0 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? smp_apic_timer_interrupt+0x38/0x50 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? apic_timer_interrupt+0x34/0x3c Jun 26 14:51:01 gosford.compton.nu kernel: [] ? kmem_cache_alloc_trace+0x1bd/0x1f0 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? minstrel_ht_update_rates+0x8d/0xc0 [mac80211] Jun 26 14:51:01 gosford.compton.nu kernel: [] ? minstrel_ht_update_caps+0x369/0x450 [mac80211] Jun 26 14:51:01 gosford.compton.nu kernel: [] sta_info_insert_rcu+0x5e/0xa0 [mac80211] Jun 26 14:51:01 gosford.compton.nu kernel: [] ieee80211_add_station+0xbf/0x2e0 [mac80211] Jun 26 14:51:01 gosford.compton.nu kernel: [] nl80211_new_station+0x355/0x3d0 [cfg80211] Jun 26 14:51:01 gosford.compton.nu kernel: [] ? nl80211_new_key+0x250/0x250 [cfg80211] Jun 26 14:51:01 gosford.compton.nu kernel: [] genl_rcv_msg+0x219/0x390 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? netlink_unicast+0x151/0x1b0 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? genl_rcv+0x30/0x30 Jun 26 14:51:01 gosford.compton.nu kernel: [] netlink_rcv_skb+0x8e/0xb0 Jun 26 14:51:01 gosford.compton.nu kernel: [] genl_rcv+0x21/0x30 Jun 26 14:51:01 gosford.compton.nu kernel: [] netlink_unicast+0x10e/0x1b0 Jun 26 14:51:01 gosford.compton.nu kernel: [] netlink_sendmsg+0x45d/0x5c0 Jun 26 14:51:01 gosford.compton.nu kernel: [] do_sock_sendmsg+0x83/0xa0 Jun 26 14:51:01 gosford.compton.nu kernel: [] ___sys_sendmsg+0x1e7/0x240 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? sock_poll+0x100/0x100 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? __d_alloc+0x22/0x130 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? kmem_cache_alloc_trace+0x1bd/0x1f0 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? selinux_file_alloc_security+0x32/0x50 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? selinux_file_alloc_security+0x32/0x50 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? selinux_file_alloc_security+0x32/0x50 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? security_file_alloc+0x14/0x20 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? __fdget+0x12/0x20 Jun 26 14:51:01 gosford.compton.nu kernel: [] __sys_sendmsg+0x44/0x80 Jun 26 14:51:01 gosford.compton.nu kernel: [] SYSC_socketcall+0x7fe/0x9c0 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? ondemand_readahead+0x188/0x240 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? page_cache_async_readahead+0x7a/0x90 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? filemap_fault+0xcd/0x460 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? sock_destroy_inode+0x28/0x30 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? sock_destroy_inode+0x28/0x30 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? destroy_inode+0x2f/0x60 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? evict+0xd6/0x150 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? dentry_free+0x44/0x90 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? dentry_free+0x44/0x90 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? dput+0x1b8/0x1f0 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? mntput+0x20/0x40 Jun 26 14:51:01 gosford.compton.nu kernel: [] ? __fput+0x158/0x1d0 Jun 26 14:51:01 gosford.compton.nu kernel: [] SyS_socketcall+0x13/0x20 Jun 26 14:51:01 gosford.compton.nu kernel: [] sysenter_do_call+0x12/0x12 Jun 26 14:51:01 gosford.compton.nu kernel: Code: 00 00 c3 8d b6 00 00 00 00 31 c0 5d c3 8d b6 00 00 00 00 8d bf 00 00 00 00 55 89 e5 53 3e 8d 74 26 00 89 c3 e8 40 ef ff ff 89 d8 ff 08 79 05 e8 14 07 00 00 64 a1 98 00 e9 c0 89 43 1 Jun 26 14:51:01 gosford.compton.nu kernel: EIP: [] mutex_lock+0x12/0x30 SS:ESP 0068:f41c36b0 Jun 26 14:51:01 gosford.compton.nu kernel: CR2: 000000000000006c Jun 26 14:51:01 gosford.compton.nu kernel: ---[ end trace c87c66d31a89c7e4 ]--- Jun 26 14:51:01 gosford.compton.nu systemd[1]: hostapd.service: main process exited, code=killed, status=9/KILL Jun 26 14:51:01 gosford.compton.nu systemd[1]: Unit hostapd.service entered failed state. Looking at the code, it seems it faulted in start_creating in the debugfs code because d_inode(parent) was null when it tried to lock the inode's mutex. Interestingly from what I can see this is trying to create a file for the station at a path something like: ieee80211/phy0/netdev:XXXX/stations/XXXXXX but in my (currently working) boot under 4.0.4 there is no netdev directory under phy0 in debugfs... but then maybe that is the problem as well if the inode pointer was null? I'm assuming this is actually a mac80211 problem rather than a debugfs problem for now, which is why I'm seeking help here. Tom -- Tom Hughes (tom@compton.nu) http://compton.nu/