Bug 91661
Summary: | General protection fault may occur when removing TPROXY rule | ||
---|---|---|---|
Product: | Networking | Reporter: | James Oakley (jfunk) |
Component: | Netfilter/Iptables | Assignee: | networking_netfilter-iptables (networking_netfilter-iptables) |
Status: | NEW --- | ||
Severity: | normal | ||
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 3.8.0 - 3.19.0-rc5+ | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
James Oakley
2015-01-20 22:54:26 UTC
I have tracked this issue down further. It appears that the sk returned from __inet_lookup_established is a time wait socket, set on the skb by tcp_v4_early_demux. In tun_net_xmit, it attempts to set the timestamp, which appends to sk->sk_error_queue, which is uninitialized memory. If I attempt to drop the skb, it crashes later in sock_wfree: [ 265.528530] BUG: unable to handle kernel paging request at ffff880030f8ed28 [ 265.535552] IP: [<ffff880030f8ed28>] 0xffff880030f8ed28 [ 265.540818] PGD 1c72067 PUD 1c73067 PMD 30c20063 PTE 8000000030f8e163 [ 265.547402] Oops: 0011 [#1] SMP [ 265.550675] Modules linked in: xt_TPROXY xt_socket nf_defrag_ipv6 xt_REDIRECT nf_nat_redirect xt_multiport sch_htb tun xt_CLASSIFY xt_dscp xt_TCPMSS xt_mark xt_tcpudp tcp_yeah tcp_westwood tcp_veno tcp_vegas tcp_scalable tcp_lp tcp_illinois tcp_hybla tcp_htcp tcp_highspeed tcp_diag inet_diag tcp_bic xt_nat iptable_mangle iptable_nat nf_nat_ipv4 nf_nat 8021q garp mrp stp llc ipt_REJECT nf_reject_ipv4 nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack xt_comment arptable_filter arp_tables iptable_filter ip_tables x_tables nfsd auth_rpcgss oid_registry nfs_acl nfs lockd grace fscache sunrpc joydev hid_generic usbhid hid loop x86_pkg_temp_thermal intel_powerclamp intel_rapl iosf_mbi coretemp kvm_intel kvm crct10dif_pclmul crc32_pclmul ghash_clmulni_intel aesni_intel ast aes_x86_64 ttm lrw drm_kms_helper gf128mul evdev glue_helper snd_pcm iTCO_wdt iTCO_vendor_support drm snd_timer snd soundcore tpm_tis ipmi_si lpc_ich ablk_helper tpm ipmi_msghandler cryptd mfd_core pcspkr shpchp i2c_i801 battery video acpi_pad mei_me xhci_pci xhci_hcd mei button processor ext4 crc16 mbcache jbd2 sg sd_mod ahci libahci igb libata i2c_algo_bit i2c_core dca scsi_mod ehci_pci ehci_hcd crc32c_intel e1000e thermal usbcore fan ptp thermal_sys pps_core usb_common [ 265.663340] CPU: 3 PID: 0 Comm: swapper/3 Not tainted 3.19.0-rc4+ #51 [ 265.669800] Hardware name: Supermicro X10SLM-F/X10SLM-F, BIOS 2.0 04/24/2014 [ 265.676867] task: ffff88040d5e72f0 ti: ffff88040d5f0000 task.ti: ffff88040d5f0000 [ 265.684369] RIP: 0010:[<ffff880030f8ed28>] [<ffff880030f8ed28>] 0xffff880030f8ed28 [ 265.692070] RSP: 0018:ffff88041fcc3820 EFLAGS: 00010202 [ 265.697396] RAX: 00000000000008ff RBX: ffff8803f77a11c0 RCX: 0000000000000000 [ 265.704551] RDX: ffff8800d3fb0040 RSI: ffff88040c494000 RDI: ffff8803f77a11c0 [ 265.711705] RBP: ffff88041fcc3838 R08: ffff8803f83b10a0 R09: 0000000000000001 [ 265.718859] R10: 0000000000000000 R11: 0000000000000570 R12: ffff8803f8765a00 [ 265.726012] R13: 0000000000000001 R14: ffff8803f8710c00 R15: ffff8803f8765a00 [ 265.733161] FS: 0000000000000000(0000) GS:ffff88041fcc0000(0000) knlGS:0000000000000000 [ 265.741266] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 265.747875] CR2: ffff880030f8ed28 CR3: 0000000001a14000 CR4: 00000000001407e0 [ 265.755878] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 265.763881] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 265.771876] Stack: [ 265.774752] ffffffff813f2e82 0000000000000096 ffff8803f8765a00 ffff88041fcc3858 [ 265.783104] ffffffff813f7f25 0000000000000071 ffff8803f8765a00 ffff88041fcc3878 [ 265.791471] ffffffff813f8f81 ffff8803f74d6150 ffff8803f8765a00 ffff88041fcc3898 [ 265.799906] Call Trace: [ 265.803233] <IRQ> [ 265.805165] [<ffffffff813f2e82>] ? sock_wfree+0x32/0x60 [ 265.812458] [<ffffffff813f7f25>] skb_release_head_state+0x75/0xe0 [ 265.819525] [<ffffffff813f8f81>] skb_release_all+0x11/0x30 [ 265.825989] [<ffffffff813f8fe1>] __kfree_skb+0x11/0x80 [ 265.832111] [<ffffffff813f9085>] kfree_skb+0x35/0x40 [ 265.838064] [<ffffffffa06d6010>] tun_net_xmit+0x350/0x3a0 [tun] [ 265.844974] [<ffffffff81409f45>] dev_hard_start_xmit+0x275/0x330 [ 265.851989] [<ffffffff81409a0e>] ? validate_xmit_skb.isra.85+0x2e/0x2f0 [ 265.859596] [<ffffffff81429654>] sch_direct_xmit+0xa4/0x1d0 [ 265.866151] [<ffffffff8140a2af>] __dev_queue_xmit+0x2af/0x510 [ 265.872890] [<ffffffff8140a52b>] dev_queue_xmit+0xb/0x10 [ 265.879204] [<ffffffff8141206c>] neigh_direct_output+0xc/0x10 [ 265.885927] [<ffffffff8144459c>] ip_finish_output2+0x27c/0x310 [ 265.892725] [<ffffffff814441db>] ip_fragment+0x72b/0x870 [ 265.898997] [<ffffffff81438b01>] ? netfilter_net_init+0x11/0x60 [ 265.905865] [<ffffffff81444320>] ? ip_fragment+0x870/0x870 [ 265.912291] [<ffffffff81444adf>] ip_finish_output+0x4af/0x800 [ 265.918962] [<ffffffff81445731>] ip_output+0x51/0xa0 [ 265.924825] [<ffffffff814412e7>] ip_forward_finish+0x77/0x80 [ 265.931356] [<ffffffff8144160f>] ip_forward+0x31f/0x470 [ 265.937429] [<ffffffff8143f67c>] ip_rcv_finish+0x2ec/0x340 [ 265.943741] [<ffffffff8143fe16>] ip_rcv+0x336/0x3c0 [ 265.949416] [<ffffffff814690b8>] ? tcp4_gro_receive+0x178/0x1b0 [ 265.956111] [<ffffffff81407f71>] __netif_receive_skb_core+0x661/0x720 [ 265.963309] [<ffffffff8143f390>] ? inet_add_protocol+0x50/0x50 [ 265.969883] [<ffffffff81408087>] __netif_receive_skb+0x57/0x80 [ 265.976431] [<ffffffff8140826e>] netif_receive_skb_internal+0x5e/0xa0 [ 265.983569] [<ffffffff81408398>] napi_gro_complete+0xd8/0xf0 [ 265.989917] [<ffffffff81408792>] napi_gro_flush+0x72/0x90 [ 265.995998] [<ffffffff8140880a>] napi_complete_done+0x5a/0xc0 [ 266.002426] [<ffffffffa01e8931>] igb_poll+0x451/0x710 [igb] [ 266.008662] [<ffffffff814089a1>] net_rx_action+0x131/0x2f0 [ 266.014831] [<ffffffff81065d0a>] __do_softirq+0x10a/0x210 [ 266.020882] [<ffffffff81065fbd>] irq_exit+0x3d/ [ 266.026408] [<ffffffff8100faa5>] do_IRQ+0xc5/0xf0 [ 266.031754] [<ffffffff8150506d>] common_interrupt+0x6d/0x6d [ 266.037962] <EOI> [ 266.039902] [<ffffffff813d5e0c>] ? cpuidle_enter_state+0x5c/0xd0 [ 266.047309] [<ffffffff813d5e02>] ? cpuidle_enter_state+0x52/0xd0 [ 266.053727] [<ffffffff813d5f52>] cpuidle_enter+0x12/0x20 [ 266.059426] [<ffffffff81099149>] cpu_startup_entry+0x229/0x300 [ 266.065645] [<ffffffff8103f094>] start_secondary+0x1b4/0x1c0 [ 266.071709] Code: 00 00 00 40 dd a8 81 ff ff ff ff 79 e2 00 00 03 88 ff ff 01 00 00 00 00 00 ad de 00 00 00 00 00 00 00 00 d8 dd b0 05 00 c9 ff ff <58> f0 c0 ff 03 88 ff ff 00 00 00 00 00 00 00 00 84 0e fd f6 07 [ 266.092288] RIP [<ffff880030f8ed28>] 0xffff880030f8ed28 [ 266.097971] RSP <ffff88041fcc3820> [ 266.101808] CR2: ffff880030f8ed28 [ 266.105464] ---[ end trace 753c193a4a34f813 ]--- I suspect the skb probably shouldn't be getting this far, but I am not familiar enough with the code to know where or how this should be handled. |