Hi Simon, I just gave your patch a try on my laptop and could successfully, reproduceably crash my kernel in the following way: Setting up wifi to ad-hoc mode and connecting it to other batman-wifi-nodes, insmodding batman-adv on my laptop and adding this wifi interface to batman -> kernel hangs (see the two attachements for more detailed error messages thrown by the kernel).
I'm not an expert in this, just a guess: Could it be, that purge_orig() is executing the spinlock first and calling free_orig_node() then, which tries to lock the same variable again, resulting into a deadlock? Cheers, Linus
[21060.326349] batman-adv:Adding interface: wlan1 [21060.337123] batman-adv:Interface activated: wlan1 [21125.872005] BUG: soft lockup - CPU#0 stuck for 61s! [bat_events:5157] [21125.872007] Modules linked in: batman_adv(-) tun nvidia(P) uinput ppdev lp parport sco bridge stp bnep rfcomm kvm_intel kvm acpi_cpufreq cpufreq_powersave cpufreq_conservative cpufreq_userspace cpufreq_stats l2cap fuse dm_snapshot dm_mirror dm_region_hash dm_log firewire_sbp2 loop snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_pcm_oss uvcvideo snd_mixer_oss arc4 ecb btusb snd_pcm snd_seq_midi snd_rawmidi videodev snd_seq_midi_event snd_seq v4l1_compat snd_timer iwlagn v4l2_compat_ioctl32 snd_seq_device iwlcore bluetooth snd i2c_i801 mac80211 soundcore i2c_core acer_wmi button processor ac battery snd_page_alloc cfg80211 psmouse evdev pcspkr serio_raw wmi rfkill ext3 jbd mbcache sha256_generic cryptd aes_x86_64 aes_generic cbc dm_crypt dm_mod ide_cd_mod sd_mod crc_t10dif cdrom ata_generic ide_pci_generic mmc_block ahci uhci_hcd libata piix ide_core sdhci_pci sdhci tg3 ricoh_mmc libphy firewire_ohci firewire_core crc_itu_t scsi_mod mmc_core led_class intel_agp video output ehci_hcd thermal fan thermal_sys [last unloaded: batman_adv] [21125.872007] CPU 0: [21125.872007] Modules linked in: batman_adv(-) tun nvidia(P) uinput ppdev lp parport sco bridge stp bnep rfcomm kvm_intel kvm acpi_cpufreq cpufreq_powersave cpufreq_conservative cpufreq_userspace cpufreq_stats l2cap fuse dm_snapshot dm_mirror dm_region_hash dm_log firewire_sbp2 loop snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_pcm_oss uvcvideo snd_mixer_oss arc4 ecb btusb snd_pcm snd_seq_midi snd_rawmidi videodev snd_seq_midi_event snd_seq v4l1_compat snd_timer iwlagn v4l2_compat_ioctl32 snd_seq_device iwlcore bluetooth snd i2c_i801 mac80211 soundcore i2c_core acer_wmi button processor ac battery snd_page_alloc cfg80211 psmouse evdev pcspkr serio_raw wmi rfkill ext3 jbd mbcache sha256_generic cryptd aes_x86_64 aes_generic cbc dm_crypt dm_mod ide_cd_mod sd_mod crc_t10dif cdrom ata_generic ide_pci_generic mmc_block ahci uhci_hcd libata piix ide_core sdhci_pci sdhci tg3 ricoh_mmc libphy firewire_ohci firewire_core crc_itu_t scsi_mod mmc_core led_class intel_agp video output ehci_hcd thermal fan thermal_sys [last unloaded: batman_adv] [21125.872007] Pid: 5157, comm: bat_events Tainted: P 2.6.31-1-amd64 #1 ��������������� [21125.872007] RIP: 0010:[<ffffffff812de34a>] [<ffffffff812de34a>] _spin_lock+0xf/0x1b [21125.872007] RSP: 0000:ffff88007dd99d98 EFLAGS: 00000297 [21125.872007] RAX: 0000000000000008 RBX: ffff88004f878b40 RCX: 0000000000000001 [21125.872007] RDX: 0000000000000007 RSI: ffffffffa0e8f02b RDI: ffff88004f878b90 [21125.872007] RBP: ffffffff8101166e R08: ffff88007d5eca20 R09: 000000000000000f [21125.872007] R10: 0000000000000020 R11: 0000000000000000 R12: 0000000000000000 [21125.872007] R13: ffff88007d9d0000 R14: ffff88005f1f2c80 R15: ffff880070052000 [21125.872007] FS: 0000000000000000(0000) GS:ffff880001643000(0000) knlGS:0000000000000000 [21125.872007] CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b [21125.872007] CR2: 00000000f39dc000 CR3: 0000000001001000 CR4: 00000000000026f0 [21125.872007] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [21125.872007] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [21125.872007] Call Trace: [21125.872007] [<ffffffffa0e8c78a>] ? free_orig_node+0x26/0x84 [batman_adv] [21125.872007] [<ffffffffa0e8ca18>] ? purge_orig+0x198/0x1d8 [batman_adv] [21125.872007] [<ffffffffa0e8c880>] ? purge_orig+0x0/0x1d8 [batman_adv] [21125.872007] [<ffffffff8105b43b>] ? worker_thread+0x174/0x211 [21125.872007] [<ffffffff8105f39e>] ? autoremove_wake_function+0x0/0x2e [21125.872007] [<ffffffff8105b2c7>] ? worker_thread+0x0/0x211 [21125.872007] [<ffffffff8105f042>] ? kthread+0x8b/0x93 [21125.872007] [<ffffffff81011baa>] ? child_rip+0xa/0x20 [21125.872007] [<ffffffff8105efb7>] ? kthread+0x0/0x93 [21125.872007] [<ffffffff81011ba0>] ? child_rip+0x0/0x20
[ 4412.876146] wlan1: Trigger new scan to find an IBSS to join [ 4417.816058] wlan1: Trigger new scan to find an IBSS to join [ 4420.102974] wlan1: Creating new IBSS network, BSSID 1a:f2:51:40:bc:e9 [ 4421.761168] wlan1: Selected IBSS BSSID 02:22:b0:44:94:5d based on configured SSID [ 4433.902832] batman-adv:B.A.T.M.A.N. advanced 0.2.1-beta r1489 (compatibility version 8) loaded [ 4440.853737] batman-adv:Adding interface: wlan1 [ 4440.865090] batman-adv:Interface activated: wlan1 [ 4441.410248] NOHZ: local_softirq_pending 08 [ 4506.496007] BUG: soft lockup - CPU#0 stuck for 61s! [bat_events:13855] [ 4506.496007] Modules linked in: batman_adv nvidia(P) uinput ppdev lp parport sco bridge stp rfcomm bnep kvm_intel kvm acpi_cpufreq cpufreq_powersave cpufreq_conservative cpufreq_userspace cpufreq_stats l2cap fuse dm_snapshot dm_mirror dm_region_hash dm_log firewire_sbp2 loop arc4 ecb iwlagn iwlcore acer_wmi snd_hda_codec_realtek mac80211 snd_hda_intel snd_hda_codec snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq uvcvideo snd_timer snd_seq_device videodev snd v4l1_compat soundcore i2c_i801 btusb v4l2_compat_ioctl32 snd_page_alloc bluetooth cfg80211 wmi rfkill i2c_core pcspkr psmouse evdev ac processor button serio_raw battery ext3 jbd mbcache sha256_generic cryptd aes_x86_64 aes_generic cbc dm_crypt dm_mod ide_cd_mod sd_mod cdrom crc_t10dif ata_generic ide_pci_generic ahci libata uhci_hcd piix ide_core scsi_mod tg3 libphy sdhci_pci sdhci ricoh_mmc firewire_ohci firewire_core crc_itu_t mmc_core led_class intel_agp video output ehci_hcd thermal fan thermal_sys [last unloaded: batman_adv] [ 4506.496007] CPU 0: [ 4506.496007] Modules linked in: batman_adv nvidia(P) uinput ppdev lp parport sco bridge stp rfcomm bnep kvm_intel kvm acpi_cpufreq cpufreq_powersave cpufreq_conservative cpufreq_userspace cpufreq_stats l2cap fuse dm_snapshot dm_mirror dm_region_hash dm_log firewire_sbp2 loop arc4 ecb iwlagn iwlcore acer_wmi snd_hda_codec_realtek mac80211 snd_hda_intel snd_hda_codec snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq uvcvideo snd_timer snd_seq_device videodev snd v4l1_compat soundcore i2c_i801 btusb v4l2_compat_ioctl32 snd_page_alloc bluetooth cfg80211 wmi rfkill i2c_core pcspkr psmouse evdev ac processor button serio_raw battery ext3 jbd mbcache sha256_generic cryptd aes_x86_64 aes_generic cbc dm_crypt dm_mod ide_cd_mod sd_mod cdrom crc_t10dif ata_generic ide_pci_generic ahci libata uhci_hcd piix ide_core scsi_mod tg3 libphy sdhci_pci sdhci ricoh_mmc firewire_ohci firewire_core crc_itu_t mmc_core led_class intel_agp video output ehci_hcd thermal fan thermal_sys [last unloaded: batman_adv] [ 4506.496007] Pid: 13855, comm: bat_events Tainted: P 2.6.31-1-amd64 #1 ��������������� [ 4506.496007] RIP: 0010:[<ffffffff812de350>] [<ffffffff812de350>] _spin_lock+0x15/0x1b [ 4506.496007] RSP: 0018:ffff88005d4cfd98 EFLAGS: 00000297 [ 4506.496007] RAX: 0000000000000008 RBX: ffff88005d990440 RCX: 0000000000000001 [ 4506.496007] RDX: 0000000000000007 RSI: ffffffffa101502b RDI: ffff88005d990490 [ 4506.496007] RBP: ffffffff8101166e R08: ffff88005d507200 R09: 000000000000000f [ 4506.496007] R10: ffff880001652f20 R11: ffffffff81223a78 R12: 0000000000000000 [ 4506.496007] R13: 0000000000000286 R14: 0000000000000014 R15: ffff88005d4cfd58 [ 4506.496007] FS: 0000000000000000(0000) GS:ffff880001643000(0000) knlGS:0000000000000000 [ 4506.496007] CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b [ 4506.496007] CR2: 00000000f77d1000 CR3: 0000000001001000 CR4: 00000000000026f0 [ 4506.496007] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 4506.496007] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 4506.496007] Call Trace: [ 4506.496007] [<ffffffffa101278a>] ? free_orig_node+0x26/0x84 [batman_adv] [ 4506.496007] [<ffffffffa1012a18>] ? purge_orig+0x198/0x1d8 [batman_adv] [ 4506.496007] [<ffffffffa1012880>] ? purge_orig+0x0/0x1d8 [batman_adv] [ 4506.496007] [<ffffffff8105b43b>] ? worker_thread+0x174/0x211 [ 4506.496007] [<ffffffff8105f39e>] ? autoremove_wake_function+0x0/0x2e [ 4506.496007] [<ffffffff8105b2c7>] ? worker_thread+0x0/0x211 [ 4506.496007] [<ffffffff8105f042>] ? kthread+0x8b/0x93 [ 4506.496007] [<ffffffff81011baa>] ? child_rip+0xa/0x20 [ 4506.496007] [<ffffffff8105efb7>] ? kthread+0x0/0x93 [ 4506.496007] [<ffffffff81011ba0>] ? child_rip+0x0/0x2
signature.asc
Description: Digital signature