Chion82 / netfilter-full-cone-nat

A kernel module to turn MASQUERADE into full cone SNAT
GNU General Public License v2.0
427 stars 121 forks source link

与 IPSec 隧道冲突 #15

Closed LGA1150 closed 6 years ago

LGA1150 commented 6 years ago

一有数据传输就会 kernel panic 以下是 crashlog

<1>[  122.142791] Unable to handle kernel NULL pointer dereference at virtual address 000001f4
<1>[  122.150953] pgd = dcfb0000
<1>[  122.153679] [000001f4] *pgd=1cc1f831, *pte=00000000, *ppte=00000000
<0>[  122.159984] Internal error: Oops: 17 [#1] SMP ARM
<4>[  122.164710] Modules linked in: pppoe ppp_async pptp pppox ppp_mppe ppp_generic nf_nat_pptp nf_conntrack_pptp iptable_nat ipt_REJECT ipt_MASQUERADE xt_u32 xt_time xt_tcpudp xt_tcpmss xt_string xt_statistic xt_state xt_recent xt_quota xt_policy xt_pkttype xt_owner xt_nat xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_helper xt_esp xt_ecn xt_dscp xt_conntrack xt_connmark xt_connlimit xt_connbytes xt_comment xt_addrtype xt_TPROXY xt_TCPMSS xt_REDIRECT xt_NETMAP xt_LOG xt_HL xt_FULLCONENAT xt_FLOWOFFLOAD xt_DSCP xt_CT xt_CLASSIFY ums_usbat ums_sddr55 ums_sddr09 ums_karma ums_jumpshot ums_isd200 ums_freecom ums_datafab ums_cypress ums_alauda ts_fsm ts_bm slhc nf_reject_ipv4 nf_nat_tftp nf_nat_snmp_basic nf_nat_sip nf_nat_redirect nf_nat_proto_gre nf_nat_masquerade_ipv4 nf_nat_irc nf_conntrack_ipv4
<4>[  122.236025]  nf_nat_ipv4 nf_nat_h323 nf_nat_ftp nf_nat_amanda nf_log_ipv4 nf_flow_table_hw nf_flow_table nf_defrag_ipv4 nf_conntrack_tftp nf_conntrack_snmp nf_conntrack_sip nf_conntrack_rtcache nf_conntrack_proto_gre nf_conntrack_irc nf_conntrack_h323 nf_conntrack_ftp nf_conntrack_broadcast ts_kmp nf_conntrack_amanda macvlan iptable_raw iptable_mangle iptable_filter ipt_ah ipt_ECN ip6table_raw ip_tables fou6 fou crc_ccitt fuse tcp_bbr evdev input_core mwlwifi mac80211 cfg80211 compat cryptodev xt_set ip_set_list_set ip_set_hash_netiface ip_set_hash_netport ip_set_hash_netnet ip_set_hash_net ip_set_hash_netportnet ip_set_hash_mac ip_set_hash_ipportnet ip_set_hash_ipportip ip_set_hash_ipport ip_set_hash_ipmark ip_set_hash_ip ip_set_bitmap_port ip_set_bitmap_ipmac ip_set_bitmap_ip ip_set nfnetlink ip6t_NPT
<4>[  122.307526]  ip6t_MASQUERADE nf_nat_masquerade_ipv6 ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 nf_nat nf_conntrack ip6t_rt ip6t_frag ip6t_hbh ip6t_eui64 ip6t_mh ip6t_ah ip6t_ipv6header ip6t_REJECT nf_reject_ipv6 nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables x_tables msdos ip6_gre ip_gre gre l2tp_ip6 l2tp_ip l2tp_eth ip6_vti ip_vti sit l2tp_netlink l2tp_core ipcomp6 xfrm6_tunnel xfrm6_mode_tunnel xfrm6_mode_transport xfrm6_mode_beet esp6 ah6 ipcomp xfrm4_tunnel xfrm4_mode_tunnel xfrm4_mode_transport xfrm4_mode_beet esp4 ah4 ipip ip6_tunnel tunnel6 tunnel4 ip_tunnel tun af_key xfrm_user xfrm_ipcomp xfrm_algo vfat fat ntfs autofs4 nls_utf8 nls_iso8859_1 nls_cp936 nls_cp437 vxlan udp_tunnel ip6_udp_tunnel sha256_generic jitterentropy_rng drbg md5 hmac echainiv ecb
<4>[  122.378523]  cbc authenc gpio_button_hotplug
<4>[  122.382814] CPU: 0 PID: 5891 Comm: ping Not tainted 4.14.48 #0
<4>[  122.388669] Hardware name: Marvell Armada 380/385 (Device Tree)
<4>[  122.394611] task: df5ca800 task.stack: dcde4000
<4>[  122.399168] PC is at fullconenat_tg+0x47c/0x680 [xt_FULLCONENAT]
<4>[  122.405201] LR is at fullconenat_tg+0x1c0/0x680 [xt_FULLCONENAT]
<4>[  122.411231] pc : [<bf6e9b48>]    lr : [<bf6e988c>]    psr: 80000013
<4>[  122.417522] sp : dcde5c28  ip : 00000000  fp : 00000000
<4>[  122.422766] r10: db81f80a  r9 : 00000000  r8 : dcc5f840
<4>[  122.428011] r7 : dcde5cc8  r6 : de9439c8  r5 : c0a03c08  r4 : db81f800
<4>[  122.434563] r3 : 00000000  r2 : 00001043  r1 : 00000000  r0 : bf6eb24c
<4>[  122.441116] Flags: Nzcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
<4>[  122.448280] Control: 10c5387d  Table: 1cfb004a  DAC: 00000051
<0>[  122.454048] Process ping (pid: 5891, stack limit = 0xdcde4210)
<0>[  122.459903] Stack: (0xdcde5c28 to 0xdcde6000)
<0>[  122.464277] 5c20:                   00000000 00000001 00000012 00000000 00000000 00000000
<0>[  122.472488] 5c40: 00000000 00021703 0100020a 00000000 00000000 00000001 00000000 00000000
<0>[  122.480698] 5c60: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ab235c6b
<0>[  122.488910] 5c80: bf60f780 de943818 dcc82054 bf5222c0 dcc5f840 dd226000 00000000 bf5210e8
<0>[  122.497122] 5ca0: de9439a8 bf51f698 c0a03cdc de940000 00000001 c09479cc dcf48180 00000001
<0>[  122.505333] 5cc0: de940040 de940010 bf6eb050 de9439c8 dcde5d64 00000000 00000014 ddc1c000
<0>[  122.513544] 5ce0: db8a0040 00000002 dcc5f840 db81f800 bf81c00c 00000000 dcde5d64 00000000
<0>[  122.521756] 5d00: 00069d14 bf6074d8 00000001 dcc5f840 dcde5d64 dd87da80 dcc5f840 dcde5d64
<0>[  122.529967] 5d20: 00000000 bf6075b4 00000001 00000001 dd87da88 c053e8c4 c0a29600 de151340
<0>[  122.538178] 5d40: c0a03c08 dcc5f840 c0a29600 de151340 c0a03c08 00000040 00000000 c05946f8
<0>[  122.546389] 5d60: dd226000 00000004 c0a29602 00000000 dd226000 de151340 c0a29600 c059440c
<0>[  122.554601] 5d80: de151340 dcde5edc dcde5dc0 c054a5f4 de151340 c056f674 00000040 00000000
<0>[  122.562812] 5da0: dcde5dd8 dcde5dc0 00000000 014200ca 00000000 df403300 dccf2e04 df404000
<0>[  122.571023] 5dc0: 00000000 c0a3191c dcde5edc c0940008 00000002 00000002 00000000 c07f0000
<0>[  122.579235] 5de0: 0100020a 00000000 00000000 ffff0000 dcc40800 00000000 df404000 00000002
<0>[  122.587447] 5e00: dce80400 dcc4000b 00000002 dce80400 00000012 00000001 00000000 00010000
<0>[  122.595658] 5e20: 00000000 60000013 00000000 00000000 00000000 00000000 0200020a 0100020a
<0>[  122.603870] 5e40: 00000008 dcde5e4c dcd7d178 00000000 00000000 00000000 dcde5e58 dcde5e58
<0>[  122.612082] 5e60: dcd7d000 df391a20 00069d00 0000000c 0000000c dd8e6e40 ffffe000 c0153cfc
<0>[  122.620293] 5e80: 00000004 00000400 df5ca880 ab235c6b 00000051 00000000 c0a03c08 00000000
<0>[  122.628505] 5ea0: df3b9c80 c0107b24 dcde4000 00000000 00069d14 c04f0ba4 00000000 c04f1b44
<0>[  122.636716] 5ec0: dcde5ee4 c01493dc 00000000 00000000 00000000 00084a40 00000040 dcde5f0c
<0>[  122.644927] 5ee0: 0000001c 00000001 00000000 00000000 dcde5edc 00000000 00000000 00000000
<0>[  122.653138] 5f00: 00000000 00000000 c0732b00 00000002 0100020a 00000000 00000000 00000000
<0>[  122.661349] 5f20: 00000000 00000000 c0a03c08 de151340 00000000 c04f5e24 c0a565c0 00005f2a
<0>[  122.669560] 5f40: 01d271c0 00000000 6fb93af2 00018252 00000051 bec37c90 00084930 00000107
<0>[  122.677771] 5f60: c0107b24 bec37c90 00000008 00000000 00000051 c016e6c0 5b181cd0 01d271c0
<0>[  122.685982] 5f80: 00000000 c01792b0 5b181cd0 ab235c6b 01d271c0 00084468 0000001c 00084410
<0>[  122.694193] 5fa0: 00000122 c0107940 00084468 0000001c 00000000 00084a40 00000040 00000000
<0>[  122.702404] 5fc0: 00084468 0000001c 00084410 00000122 00000001 00069bf4 00069ca0 00069d14
<0>[  122.710615] 5fe0: bec37c58 bec37c44 b6f23298 b6f2278c 60000010 00000000 00000000 00000000
<4>[  122.718885] [<bf6e9b48>] (fullconenat_tg [xt_FULLCONENAT]) from [<bf51f698>] (ipt_do_table+0x534/0x6f4 [ip_tables])
<4>[  122.729385] [<bf51f698>] (ipt_do_table [ip_tables]) from [<bf6074d8>] (nf_nat_ipv4_fn+0xbc/0x188 [nf_nat_ipv4])
<4>[  122.739530] [<bf6074d8>] (nf_nat_ipv4_fn [nf_nat_ipv4]) from [<bf6075b4>] (nf_nat_ipv4_out+0x10/0xa8 [nf_nat_ipv4])
<4>[  122.750022] [<bf6075b4>] (nf_nat_ipv4_out [nf_nat_ipv4]) from [<c053e8c4>] (nf_hook_slow+0x2c/0xb8)
<4>[  122.759108] [<c053e8c4>] (nf_hook_slow) from [<c05946f8>] (xfrm4_output+0x88/0x98)
<4>[  122.766712] [<c05946f8>] (xfrm4_output) from [<c054a5f4>] (ip_send_skb+0x10/0x2c)
<4>[  122.774226] [<c054a5f4>] (ip_send_skb) from [<c056f674>] (raw_sendmsg+0x754/0x878)
<4>[  122.781830] [<c056f674>] (raw_sendmsg) from [<c04f0ba4>] (sock_sendmsg+0x14/0x24)
<4>[  122.789345] [<c04f0ba4>] (sock_sendmsg) from [<c04f1b44>] (SyS_sendto+0xc4/0x100)
<4>[  122.796862] [<c04f1b44>] (SyS_sendto) from [<c0107940>] (ret_fast_syscall+0x0/0x54)
<0>[  122.804551] Code: e1cd65b2 e58d302c eaffffff e5983014 (e59331f4) 
<4>[  122.810700] ---[ end trace 3cbaced1024c75ca ]---
Chion82 commented 6 years ago

kernel panic 已fixed. 为了避免 nat 影响 ipsec 隧道,iptables中不要让 ipsec 流量经过 FULLCONENAT。