imq / linuximq

Pseudo-driver for the intermediate queue device.
https://imq.github.io/
GNU General Public License v2.0
99 stars 51 forks source link

#45 Fix missing exports in 4.8 patch. #46

Closed k0ste closed 8 years ago

k0ste commented 8 years ago

Fix #45.

k0ste commented 8 years ago

Notice: this patch not working correctly with htb+sfq qdisc on imq interface. Use stable patch for 4.7.

micron10 commented 8 years ago

Hi K0ste Hear is dump from my console after up imq and add iptables rules + hsfp shapers machine crash please see dump: This dump is from Kernel 4.8.1 with your latest patch

[48137.977771] mpt3sas version 13.100.00.00 loaded [48162.115442] IMQ driver loaded successfully. (numdevs = 2, numqueues = 1, imq_dev_accurate_stats = 1) [48162.139578] Hooking IMQ before NAT on PREROUTING. [48162.152283] Hooking IMQ before NAT on POSTROUTING. [48176.852343] BUG: unable to handle kernel NULL pointer dereference at (null) [48176.852796] IP: [] noop_enqueue+0x0/0x10 [48176.852800] PGD 216979067 PUD 216aeb067 PMD 0 [48176.852802] Oops: 0000 [#1] SMP [48176.852802] Modules linked in: sch_hfsc imq mpt3sas raid_class scsi_transport_sas udp_diag unix_diag af_packet_diag xt_TCPMSS ipt_REJECT nf_reject_ipv4 iptable_filter xt_IMQ iptable_mangle xt_nat xt_addrtype iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 ip_tables ppp_async crc_ccitt l2tp_ppp l2tp_netlink l2tp_core eoip netconsole pppoe w83627ehf hwmon_vid pcnet32 de4x5 tulip dmfe ne2k_pci 8390 b44 ssb natsemi 3c59x fealnx via_rhine sis900 e100 8139cp 8139too dl2k acenic r8169 mii sky2 tg3 libphy e1000e e1000 igb i2c_algo_bit ptp pps_core nf_nat_ftp nf_conntrack_ftp nf_nat_pptp nf_nat_proto_gre nf_conntrack_pptp nf_conntrack_proto_gre nf_nat nf_conntrack pptp gre pppox mcryptd sha1_ssse3 sha1_generic arc4 ecb ppp_mppe ppp_generic slhc IA(O) [last unloaded: mpt3sas] [48176.852823] CPU: 1 PID: 2601 Comm: mysqld Tainted: G O 4.8.1 #1 [48176.852824] Hardware name: Supermicro X9SCL/X9SCM/X9SCL/X9SCM, BIOS 2.0b 09/17/2012 [48176.852824] task: ffff880215f56780 task.stack: ffff880216198000 [48176.852826] RIP: 0010:[] [] noop_enqueue+0x0/0x10 [48176.852827] RSP: 0000:ffff880227303bd0 EFLAGS: 00010246 [48176.852827] RAX: 00000000000005dc RBX: ffff8801d42f8900 RCX: 0000000004000000 [48176.852828] RDX: 0000000000000000 RSI: ffffffff8187abc0 RDI: ffff8801d42f8900 [48176.852828] RBP: ffffffff8187abc0 R08: 0000000000097280 R09: ffffffff814509e5 [48176.852829] R10: 0000000080000000 R11: 0000000000000004 R12: 0000000000000001 [48176.852829] R13: ffff88021678fb00 R14: 0000000000000000 R15: ffff880224817000 [48176.852830] FS: 00007fad900ec700(0000) GS:ffff880227300000(0000) knlGS:0000000000000000 [48176.852831] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [48176.852831] CR2: 0000000000000000 CR3: 00000002163bd000 CR4: 00000000001406e0 [48176.852831] Stack: [48176.852833] ffffffffa0060359 ffff8802265a0000 ffff8802243c2010 0000000000000004 [48176.852833] ffff88021678fb00 0000000000000001 ffff8801d42f8900 ffffffffa0061010 [48176.852834] ffff8801d42f8900 ffff880215b87b48 ffffffffa0060b75 ffff88021678fb00 [48176.852835] Call Trace: [48176.852838] [48176.852838] [] ? imq_nf_queue+0xe9/0x6b0 [imq] [48176.852839] [] ? imq_nf_queue+0x255/0x364 [imq] [48176.852841] [] ? ip_fragment.constprop.5+0x70/0x70 [48176.852843] [] ? nf_queue+0x12f/0x190 [48176.852844] [] ? nf_hook_slow+0x5b/0xb0 [48176.852845] [] ? ip_output+0xa4/0xc0 [48176.852846] [] ? ip_fragment.constprop.5+0x70/0x70 [48176.852847] [] ? ip_forward+0x3ab/0x420 [48176.852848] [] ? ip_frag_mem+0x40/0x40 [48176.852849] [] ? ip_rcv+0x2e0/0x370 [48176.852851] [] ? packet_rcv+0x282/0x3b0 [48176.852852] [] ? ip_local_deliver_finish+0x1b0/0x1b0 [48176.852854] [] ? netif_receive_skb_core+0x3e6/0x9a0 [48176.852855] [] ? br_handle_frame_finish+0x490/0x4d0 [48176.852856] [] ? task_tick_fair+0x5a7/0x9a0 [48176.852857] [] ? process_backlog+0x7c/0x110 [48176.852858] [] ? net_rx_action+0x1d7/0x2e0 [48176.852860] [] ? __do_softirq+0xf7/0x200 [48176.852861] [] ? irq_exit+0xbd/0xd0 [48176.852863] [] ? call_function_single_interrupt+0x81/0x90 [48176.852864] [48176.852873] Code: c7 04 c5 20 02 89 81 00 00 00 00 eb c1 e8 39 f0 ff ff 5b 48 c7 c7 80 ab 87 81 e9 4c 7f 0f 00 66 2e 0f 1f 84 00 00 00 00 00 66 90 <48> 8b 02 48 89 07 b8 02 00 00 00 48 89 3a c3 90 31 c0 c3 0f 1f [48176.852874] RIP [] noop_enqueue+0x0/0x10 [48176.852875] RSP [48176.852875] CR2: 0000000000000000 [48176.852876] ---[ end trace 809d9adbbcd8b210 ]--- [48176.852876] Kernel panic - not syncing: Fatal exception in interrupt [48176.878345] Kernel Offset: disabled [48177.979776] Rebooting in 10 seconds.. [48188.031851] ACPI MEMORY or I/O RESET_REG.

vel21ripn commented 8 years ago

Bug in imq.c:__imq_nf_queue()

struct sk_buff **to_free;

Must be

struct sk_buff *to_free=NULL;

and

qdisc_enqueue(skb_shared, q, to_free);

Must be

qdisc_enqueue(skb_shared, q, &to_free);

Maybe need a code "if (to_free) kfree_skb (to_free);" after label "out:" and before return ?

k0ste commented 8 years ago

Updated, due @vel21ripn fixes.