From: Ben Hutchings <ben@decadent.org.uk>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: akpm@linux-foundation.org,
"Hannes Frederic Sowa" <hannes@stressinduktion.org>,
"Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>,
"David S. Miller" <davem@davemloft.net>
Subject: [011/121] ipv6: take rtnl_lock and mark mrt6 table as freed on namespace cleanup
Date: Sun, 08 Sep 2013 03:52:01 +0100 [thread overview]
Message-ID: <lsq.1378608721.687802947@decadent.org.uk> (raw)
In-Reply-To: <lsq.1378608720.401499712@decadent.org.uk>
3.2.51-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
[ Upstream commit 905a6f96a1b18e490a75f810d733ced93c39b0e5 ]
Otherwise we end up dereferencing the already freed net->ipv6.mrt pointer
which leads to a panic (from Srivatsa S. Bhat):
BUG: unable to handle kernel paging request at ffff882018552020
IP: [<ffffffffa0366b02>] ip6mr_sk_done+0x32/0xb0 [ipv6]
PGD 290a067 PUD 207ffe0067 PMD 207ff1d067 PTE 8000002018552060
Oops: 0000 [#1] SMP DEBUG_PAGEALLOC
Modules linked in: ebtable_nat ebtables nfs fscache nf_conntrack_ipv4 nf_defrag_ipv4 ipt_REJECT xt_CHECKSUM iptable_mangle iptable_filter ip_tables nfsd lockd nfs_acl exportfs auth_rpcgss autofs4 sunrpc 8021q garp bridge stp llc ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 xt_state nf_conntrack ip6table_filter
+ip6_tables ipv6 vfat fat vhost_net macvtap macvlan vhost tun kvm_intel kvm uinput iTCO_wdt iTCO_vendor_support cdc_ether usbnet mii microcode i2c_i801 i2c_core lpc_ich mfd_core shpchp ioatdma dca mlx4_core be2net wmi acpi_cpufreq mperf ext4 jbd2 mbcache dm_mirror dm_region_hash dm_log dm_mod
CPU: 0 PID: 7 Comm: kworker/u33:0 Not tainted 3.11.0-rc1-ea45e-a #4
Hardware name: IBM -[8737R2A]-/00Y2738, BIOS -[B2E120RUS-1.20]- 11/30/2012
Workqueue: netns cleanup_net
task: ffff8810393641c0 ti: ffff881039366000 task.ti: ffff881039366000
RIP: 0010:[<ffffffffa0366b02>] [<ffffffffa0366b02>] ip6mr_sk_done+0x32/0xb0 [ipv6]
RSP: 0018:ffff881039367bd8 EFLAGS: 00010286
RAX: ffff881039367fd8 RBX: ffff882018552000 RCX: dead000000200200
RDX: 0000000000000000 RSI: ffff881039367b68 RDI: ffff881039367b68
RBP: ffff881039367bf8 R08: ffff881039367b68 R09: 2222222222222222
R10: 2222222222222222 R11: 2222222222222222 R12: ffff882015a7a040
R13: ffff882014eb89c0 R14: ffff8820289e2800 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff88103fc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffff882018552020 CR3: 0000000001c0b000 CR4: 00000000000407f0
Stack:
ffff881039367c18 ffff882014eb89c0 ffff882015e28c00 0000000000000000
ffff881039367c18 ffffffffa034d9d1 ffff8820289e2800 ffff882014eb89c0
ffff881039367c58 ffffffff815bdecb ffffffff815bddf2 ffff882014eb89c0
Call Trace:
[<ffffffffa034d9d1>] rawv6_close+0x21/0x40 [ipv6]
[<ffffffff815bdecb>] inet_release+0xfb/0x220
[<ffffffff815bddf2>] ? inet_release+0x22/0x220
[<ffffffffa032686f>] inet6_release+0x3f/0x50 [ipv6]
[<ffffffff8151c1d9>] sock_release+0x29/0xa0
[<ffffffff81525520>] sk_release_kernel+0x30/0x70
[<ffffffffa034f14b>] icmpv6_sk_exit+0x3b/0x80 [ipv6]
[<ffffffff8152fff9>] ops_exit_list+0x39/0x60
[<ffffffff815306fb>] cleanup_net+0xfb/0x1a0
[<ffffffff81075e3a>] process_one_work+0x1da/0x610
[<ffffffff81075dc9>] ? process_one_work+0x169/0x610
[<ffffffff81076390>] worker_thread+0x120/0x3a0
[<ffffffff81076270>] ? process_one_work+0x610/0x610
[<ffffffff8107da2e>] kthread+0xee/0x100
[<ffffffff8107d940>] ? __init_kthread_worker+0x70/0x70
[<ffffffff8162a99c>] ret_from_fork+0x7c/0xb0
[<ffffffff8107d940>] ? __init_kthread_worker+0x70/0x70
Code: 20 48 89 5d e8 4c 89 65 f0 4c 89 6d f8 66 66 66 66 90 4c 8b 67 30 49 89 fd e8 db 3c 1e e1 49 8b 9c 24 90 08 00 00 48 85 db 74 06 <4c> 39 6b 20 74 20 bb f3 ff ff ff e8 8e 3c 1e e1 89 d8 4c 8b 65
RIP [<ffffffffa0366b02>] ip6mr_sk_done+0x32/0xb0 [ipv6]
RSP <ffff881039367bd8>
CR2: ffff882018552020
Reported-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Tested-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
net/ipv6/ip6mr.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 449a918..f5af259 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -257,10 +257,12 @@ static void __net_exit ip6mr_rules_exit(struct net *net)
{
struct mr6_table *mrt, *next;
+ rtnl_lock();
list_for_each_entry_safe(mrt, next, &net->ipv6.mr6_tables, list) {
list_del(&mrt->list);
ip6mr_free_table(mrt);
}
+ rtnl_unlock();
fib_rules_unregister(net->ipv6.mr6_rules_ops);
}
#else
@@ -287,7 +289,10 @@ static int __net_init ip6mr_rules_init(struct net *net)
static void __net_exit ip6mr_rules_exit(struct net *net)
{
+ rtnl_lock();
ip6mr_free_table(net->ipv6.mrt6);
+ net->ipv6.mrt6 = NULL;
+ rtnl_unlock();
}
#endif
next prev parent reply other threads:[~2013-09-08 3:20 UTC|newest]
Thread overview: 134+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-08 2:52 [000/121] 3.2.51-rc1 review Ben Hutchings
2013-09-08 2:52 ` [081/121] xen/events: mask events when changing their VCPU binding Ben Hutchings
2013-09-08 2:52 ` [003/121] libata: make it clear that sata_inic162x is experimental Ben Hutchings
2013-09-08 2:52 ` [109/121] drm/vmwgfx: Split GMR2_REMAP commands if they are to large Ben Hutchings
2013-09-08 2:52 ` [077/121] USB: keyspan: fix null-deref at disconnect and release Ben Hutchings
2013-09-08 2:52 ` [114/121] m32r: make memset() global for CONFIG_KERNEL_BZIP2=y Ben Hutchings
2013-09-08 2:52 ` [119/121] target: Fix trailing ASCII space usage in INQUIRY vendor+model Ben Hutchings
2013-09-08 2:52 ` [055/121] iwl4965: reset firmware after rfkill off Ben Hutchings
2013-09-08 2:52 ` [104/121] sunrpc: remove the second argument of k[un]map_atomic() Ben Hutchings
2013-09-08 2:52 ` [066/121] ALSA: 6fire: make buffers DMA-able (midi) Ben Hutchings
2013-09-08 2:52 ` [118/121] ALSA: opti9xx: Fix conflicting driver object name Ben Hutchings
2013-09-08 2:52 ` [006/121] perf: Fix event group context move Ben Hutchings
2013-09-08 2:52 ` [030/121] Bluetooth: Add support for Foxconn/Hon Hai [0489:e04d] Ben Hutchings
2013-09-08 2:52 ` [105/121] SUNRPC: Fix memory corruption issue on 32-bit highmem systems Ben Hutchings
2013-09-08 2:52 ` [023/121] jfs: fix readdir cookie incompatibility with NFSv4 Ben Hutchings
2013-09-08 2:52 ` [100/121] ath9k_htc: Restore skb headroom when returning skb to mac80211 Ben Hutchings
2013-09-08 2:52 ` [086/121] [SCSI] zfcp: fix schedule-inside-lock in scsi_device list loops Ben Hutchings
2013-09-08 2:52 ` [018/121] ALSA: usb-audio: skip UAC2 EFFECT_UNIT Ben Hutchings
2013-09-08 2:52 ` [108/121] drm/i915: ivb: fix edp voltage swing reg val Ben Hutchings
2013-09-08 2:52 ` [028/121] iwlwifi: add DELL SKU for 5150 HMC Ben Hutchings
2013-09-08 2:52 ` [010/121] sctp: fully initialize sctp_outq in sctp_outq_init Ben Hutchings
2013-09-08 2:52 ` [048/121] rt2x00: fix stop queue Ben Hutchings
2013-09-08 2:52 ` [074/121] m68k: Truncate base in do_div() Ben Hutchings
2013-09-08 2:52 ` [022/121] NFSv4.1: integer overflow in decode_cb_sequence_args() Ben Hutchings
2013-09-08 2:52 ` [092/121] sound: Fix make allmodconfig on MIPS Ben Hutchings
2013-09-08 2:52 ` [072/121] fs/proc/task_mmu.c: fix buffer overflow in add_page_map() Ben Hutchings
2013-09-08 2:52 ` [083/121] [SCSI] sg: Fix user memory corruption when SG_IO is interrupted by a signal Ben Hutchings
2013-09-08 2:52 ` [094/121] CRIS: Add _sdata to vmlinux.lds.S Ben Hutchings
2013-09-08 2:52 ` [073/121] m68k/atari: ARAnyM - Fix NatFeat module support Ben Hutchings
2013-09-08 2:52 ` [047/121] virtio: console: return -ENODEV on all read operations after unplug Ben Hutchings
2013-09-08 2:52 ` [061/121] hwmon: (adt7470) Fix incorrect return code check Ben Hutchings
2013-09-08 2:52 ` [095/121] alpha: makefile: don't enforce small data model for kernel builds Ben Hutchings
2013-09-08 2:52 ` [035/121] Bluetooth: Add support for Atheros [0cf3:e003] Ben Hutchings
2013-09-08 2:52 ` [088/121] nilfs2: fix issue with counting number of bio requests for BIO_EOPNOTSUPP error detection Ben Hutchings
2013-09-08 2:52 ` [032/121] Bluetooth: ath3k: Add support for Fujitsu Lifebook UH5x2 [04c5:1330] Ben Hutchings
2013-09-08 2:52 ` [040/121] serial/mxs-auart: fix race condition in interrupt handler Ben Hutchings
2013-09-08 2:52 ` [113/121] m32r: add memcpy() for CONFIG_KERNEL_GZIP=y Ben Hutchings
2013-09-08 2:52 ` [027/121] iwlwifi: dvm: don't send BT_CONFIG on devices w/o Bluetooth Ben Hutchings
2013-09-08 2:52 ` [029/121] ath9k_htc: do some initial hardware configuration Ben Hutchings
2013-09-08 2:52 ` [063/121] zd1201: do not use stack as URB transfer_buffer Ben Hutchings
2013-09-08 2:52 ` [016/121] drm/i915/lvds: ditch ->prepare special case Ben Hutchings
2013-09-08 2:52 ` [053/121] iwlwifi: dvm: fix calling ieee80211_chswitch_done() with NULL Ben Hutchings
2013-09-08 2:52 ` [121/121] x86/xen: do not identity map UNUSABLE regions in the machine E820 Ben Hutchings
2013-09-08 2:52 ` [067/121] jbd2: Fix use after free after error in jbd2_journal_dirty_metadata() Ben Hutchings
2013-09-08 2:52 ` [089/121] Revert "PM / Domains: Fix handling of wakeup devices during system resume" Ben Hutchings
2013-09-08 2:52 ` [046/121] virtio: console: fix raising SIGIO after port unplug Ben Hutchings
2013-09-08 2:52 ` Ben Hutchings [this message]
2013-09-08 2:52 ` [093/121] sound: Fix make allmodconfig on MIPS correctly Ben Hutchings
2013-09-08 2:52 ` [002/121] mm/memory-hotplug: fix lowmem count overflow when offline pages Ben Hutchings
2013-09-08 2:52 ` [049/121] USB: serial: ftdi_sio: add more RT Systems ftdi devices Ben Hutchings
2013-09-08 2:52 ` [101/121] powerpc: Don't Oops when accessing /proc/powerpc/lparcfg without hypervisor Ben Hutchings
2013-09-08 2:52 ` [084/121] of: fdt: fix memory initialization for expanded DT Ben Hutchings
2013-09-08 2:52 ` [004/121] sched: Fix the broken sched_rr_get_interval() Ben Hutchings
2013-09-08 2:52 ` [106/121] drivers/base/memory.c: fix show_mem_removable() to handle missing sections Ben Hutchings
2013-09-08 2:52 ` [075/121] usb: add two quirky touchscreen Ben Hutchings
2013-09-08 2:52 ` [033/121] Bluetooth: ath3k: Add support for ID 0x13d3/0x3402 Ben Hutchings
2013-09-08 2:52 ` [076/121] USB: mos7720: fix broken control requests Ben Hutchings
2013-09-08 2:52 ` [058/121] ALSA: 6fire: fix DMA issues with URB transfer_buffer usage Ben Hutchings
2013-09-08 2:52 ` [009/121] sysctl net: Keep tcp_syn_retries inside the boundary Ben Hutchings
2013-09-08 2:52 ` [044/121] virtio: console: fix race in port_fops_open() and port unplug Ben Hutchings
2013-09-08 2:52 ` [024/121] vm: add no-mmu vm_iomap_memory() stub Ben Hutchings
2013-09-08 2:52 ` [019/121] ALSA: usb: Parse UAC2 extension unit like for UAC1 Ben Hutchings
2013-09-08 2:52 ` [117/121] sparc32: Add ucmpdi2.o to obj-y instead of lib-y Ben Hutchings
2013-09-08 2:52 ` [060/121] drm/radeon: always program the MC on startup Ben Hutchings
2013-09-08 2:52 ` [059/121] cifs: don't instantiate new dentries in readdir for inodes that need to be revalidated immediately Ben Hutchings
2013-09-08 2:52 ` [111/121] pci: frv architecture needs generic setup-bus infrastructure Ben Hutchings
2013-09-08 2:52 ` [102/121] powerpc: Work around gcc miscompilation of __pa() on 64-bit Ben Hutchings
2013-09-08 2:52 ` [082/121] block: Add bio_for_each_segment_all() Ben Hutchings
2013-09-08 2:52 ` [045/121] virtio: console: clean up port data immediately at time of unplug Ben Hutchings
2013-09-08 2:52 ` [038/121] mwifiex: Add missing endian conversion Ben Hutchings
2013-09-08 2:52 ` [096/121] [PARISC] include <linux/prefetch.h> in drivers/parisc/iommu-helpers.h Ben Hutchings
2013-09-08 2:52 ` [068/121] USB: adutux: fix big-endian device-type reporting Ben Hutchings
2013-09-08 2:52 ` [020/121] ALSA: ak4xx-adda: info leak in ak4xxx_capture_source_info() Ben Hutchings
2013-09-08 2:52 ` [091/121] microblaze: Update microblaze defconfigs Ben Hutchings
2013-09-08 2:52 ` [041/121] serial/mxs-auart: increase time to wait for transmitter to become idle Ben Hutchings
2013-09-08 2:52 ` [015/121] net_sched: info leak in atm_tc_dump_class() Ben Hutchings
2013-09-08 2:52 ` [078/121] drm/i915: Invalidate TLBs for the rings after a reset Ben Hutchings
2013-09-08 2:52 ` [112/121] m32r: consistently use "suffix-$(...)" Ben Hutchings
2013-09-10 3:59 ` Hirokazu Takata
2013-09-08 2:52 ` [071/121] perf/arm: Fix armpmu_map_hw_event() Ben Hutchings
2013-09-08 2:52 ` [079/121] libata: apply behavioral quirks to sil3826 PMP Ben Hutchings
2013-09-08 2:52 ` [085/121] [SCSI] zfcp: fix lock imbalance by reworking request queue locking Ben Hutchings
2013-09-08 2:52 ` [120/121] KVM: s390: move kvm_guest_enter,exit closer to sie Ben Hutchings
2013-09-08 2:52 ` [064/121] Hostap: copying wrong data prism2_ioctl_giwaplist() Ben Hutchings
2013-09-08 2:52 ` [080/121] xen/events: initialize local per-cpu mask for all possible events Ben Hutchings
2013-09-08 2:52 ` [036/121] ARM: 7791/1: a.out: remove partial a.out support Ben Hutchings
2013-09-08 2:52 ` [116/121] sparc32: add ucmpdi2 Ben Hutchings
2013-09-08 2:52 ` [042/121] ixgbe: Fix Tx Hang issue with lldpad on 82598EB Ben Hutchings
2013-09-08 2:52 ` [087/121] nilfs2: remove double bio_put() in nilfs_end_bio_write() for BIO_EOPNOTSUPP error Ben Hutchings
2013-09-08 2:52 ` [039/121] USB: mos7840: fix race in register handling Ben Hutchings
2013-09-08 2:52 ` [056/121] [SCSI] megaraid_sas: megaraid_sas driver init fails in kdump kernel Ben Hutchings
2013-09-08 2:52 ` [007/121] perf tools: Add anonymous huge page recognition Ben Hutchings
2013-09-08 2:52 ` [005/121] drm/i915: quirk no PCH_PWM_ENABLE for Dell XPS13 backlight Ben Hutchings
2013-09-08 2:52 ` [107/121] workqueue: cond_resched() after processing each work item Ben Hutchings
2013-09-08 2:52 ` [062/121] ext4: fix mount/remount error messages for incompatible mount options Ben Hutchings
2013-09-08 2:52 ` [069/121] USB: ti_usb_3410_5052: fix big-endian firmware handling Ben Hutchings
2013-09-08 2:52 ` [057/121] tracing: Fix fields of struct trace_iterator that are zeroed by mistake Ben Hutchings
2013-09-08 2:52 ` [098/121] Hexagon: misc compile warning/error cleanup due to missing headers Ben Hutchings
2013-09-08 2:52 ` [014/121] af_key: more info leaks in pfkey messages Ben Hutchings
2013-09-08 2:52 ` [043/121] virtio: console: fix race with port unplug and open/close Ben Hutchings
2013-09-08 2:52 ` [031/121] Bluetooth: Add support for Mediatek Bluetooth device [0e8d:763f] Ben Hutchings
2013-09-08 2:52 ` [026/121] mac80211: fix duplicate retransmission detection Ben Hutchings
2013-09-08 2:52 ` [103/121] powerpc/hvsi: Increase handshake timeout from 200ms to 400ms Ben Hutchings
2013-09-08 2:52 ` [037/121] x86, fpu: correct the asm constraints for fxsave, unbreak mxcsr.daz Ben Hutchings
2013-09-08 2:52 ` [052/121] cifs: extend the buffer length enought for sprintf() using Ben Hutchings
2013-09-09 3:03 ` Scott Lovenberg
2013-09-08 2:52 ` [051/121] drm/radeon/atom: initialize more atom interpretor elements to 0 Ben Hutchings
2013-09-08 2:52 ` [110/121] x86 get_unmapped_area: Access mmap_legacy_base through mm_struct member Ben Hutchings
2013-09-08 2:52 ` [008/121] arcnet: cleanup sizeof parameter Ben Hutchings
2013-09-08 2:52 ` [099/121] iwl4965: fix rfkill set state regression Ben Hutchings
2013-09-08 2:52 ` [013/121] net_sched: Fix stack info leak in cbq_dump_wrr() Ben Hutchings
2013-09-08 2:52 ` [025/121] nl80211: fix mgmt tx status and testmode reporting for netns Ben Hutchings
2013-09-08 2:52 ` [012/121] usbnet: do not pretend to support SG/TSO Ben Hutchings
2013-09-08 2:52 ` [050/121] ACPI / battery: Fix parsing _BIX return value Ben Hutchings
2013-09-08 2:52 ` [070/121] ARM: 7809/1: perf: fix event validation for software group leaders Ben Hutchings
2013-09-08 2:52 ` [017/121] af_key: initialize satype in key_notify_policy_flush() Ben Hutchings
2013-09-08 2:52 ` [021/121] slab: introduce kmalloc_array() Ben Hutchings
2013-09-08 2:52 ` [065/121] ALSA: 6fire: make buffers DMA-able (pcm) Ben Hutchings
2013-09-08 2:52 ` [097/121] sparc32: support atomic64_t Ben Hutchings
2013-09-08 2:52 ` [115/121] microblaze: Fix __futex_atomic_op macro register usage Ben Hutchings
2013-09-08 2:52 ` [001/121] ifb: Include <linux/sched.h> Ben Hutchings
2013-09-08 2:52 ` [090/121] SCSI: nsp32: use mdelay instead of large udelay constants Ben Hutchings
2013-09-08 2:52 ` [054/121] iwl4965: set power mode early Ben Hutchings
2013-09-08 2:52 ` [034/121] Bluetooth: Add support for Atheros [0cf3:3121] Ben Hutchings
2013-09-08 3:53 ` [000/121] 3.2.51-rc1 review Ben Hutchings
2013-09-08 7:10 ` Guenter Roeck
2013-09-08 8:18 ` Geert Uytterhoeven
2013-09-08 16:52 ` Guenter Roeck
2013-10-20 11:56 ` Ben Hutchings
2013-10-20 16:23 ` Guenter Roeck
2013-10-20 18:05 ` Ben Hutchings
2013-10-20 19:28 ` Guenter Roeck
2013-09-09 13:16 ` Greg Ungerer
2013-09-09 13:26 ` Guenter Roeck
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=lsq.1378608721.687802947@decadent.org.uk \
--to=ben@decadent.org.uk \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=hannes@stressinduktion.org \
--cc=linux-kernel@vger.kernel.org \
--cc=srivatsa.bhat@linux.vnet.ibm.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
all inboxes | Powered by JetHome®