Skip to content
This repository has been archived by the owner on Sep 9, 2019. It is now read-only.

Commit

Permalink
HACK: sch_htb: Disable LTO
Browse files Browse the repository at this point in the history
When the kernel is compiled with LTO using Clang 8.0.8 (AOSP Clang
r349610), using mobile data results in a kernel panic within 1 minute:

[   96.276191] Unable to handle kernel NULL pointer dereference at virtual address 00000017
[   96.276216] pgd = ffffff8b17b62000
[   96.276222] [00000017] *pgd=000000017900b003, *pud=000000017900b003, *pmd=0000000000000000
[   96.276239] Internal error: Oops: 96000006 [#1] PREEMPT SMP
[   96.276249] CPU: 1 PID: 19 Comm: kworker/1:0 Not tainted 4.9.158-Proton-v14 #904
[   96.276254] Hardware name: Google Pixel 3 XL (DT)
[   96.276274] Workqueue: wg-crypt-VPS wg_packet_tx_worker
[   96.276281] task: ffffffc6f9145b00 task.stack: ffffffc6f9160000
[   96.276291] PC is at htb_lookup_leaf+0xf4/0x188
[   96.276296] LR is at htb_dequeue+0x4a4/0xc5c
[   96.276301] pc : [<ffffff8b1603d52c>] lr : [<ffffff8b1603be00>] pstate: 80c00145
[   96.276305] sp : ffffffc6f9163940
[   96.276309] x29: ffffffc6f91639e0 x28: 0000000000000008
[   96.276317] x27: 0000000000000010 x26: 0000000000000000
[   96.276325] x25: ffffffc6f9145b00 x24: 00000000000000a8
[   96.276332] x23: 0000000000000000 x22: 0000000000000007
[   96.276340] x21: 0000000000000080 x20: ffffffc6f56db328
[   96.276348] x19: ffffffc6f56db000 x18: 0000000000021191
[   96.276356] x17: ffffff8b166a1e08 x16: 0000000000000007
[   96.276364] x15: ffffffc6f56db3e0 x14: 0000000000000007
[   96.276371] x13: ffffffc6f9163880 x12: 0000000000000018
[   96.276379] x11: fffffffffffffdb0 x10: 000000000000ffff
[   96.276386] x9 : ffffffc6f9163880 x8 : 0000000000000000
[   96.276393] x7 : 0000000000000001 x6 : 00000080c6ffffff
[   96.276400] x5 : ffffffc600000000 x4 : 0000000000000000
[   96.276407] x3 : 0000000000000000 x2 : ffffffc6f9163a48
[   96.276415] x1 : 0000000000000007 x0 : ffffffc6f56db3d8
[   96.276424]
[   96.276424] PC: 0xffffff8b1603d4ec:
[   96.276429] d4ec  f94001f0 b4000170 8b0b0200 b940680f 340005cf 9b0c01cf f94061f0 910321f1
[   96.276453] d50c  910341ef f8018db0 a900bdb1 14000023 f94001b0 f90001f0 f94005af f94001f0
[   96.276474] d52c  f9400a10 b5ffff90 eb0901bf 54000369 f85f01af f94001f1 b4000371 f9400230
[   96.276496] d54c  d10061ad eb11021f 54000081 aa1f03f0 f90001ff 14000011 f9400632 b40000b2
[   96.276519]
[   96.276519] LR: 0xffffff8b1603bdc0:
[   96.276524] bdc0  dac00108 dac01116 f94027e8 9106a114 8b1606c8 1ad621f5 52801909 9b0952e9
[   96.276545] bde0  2a0b02ab b90047eb d37df118 8b180128 91002100 f9001be0 2a1603e1 9400058f
[   96.276567] be00  aa0003e9 8b180288 91004118 aa0003f9 b5000197 1400005c f27ef529 540008c0
[   96.276588] be20  f940052b eb0b015f 54000861 f940012b aa0903ea f27ef569 54ffff41 1400003e
[   96.276611]
[   96.276611] SP: 0xffffffc6f9163900:
[   96.276616] 3900  1603be00 ffffff8b f9163940 ffffffc6 1603d52c ffffff8b 80c00145 00000000
[   96.276637] 3920  5ed18100 ffffffc6 63109138 ffffffc6 ffffffff ffffffff 1603ba64 ffffff8b
[   96.276659] 3940  5a92e0bc ffffffc6 f56db308 ffffffc6 f56db308 ffffffc6 71f3be66 00000016
[   96.276681] 3960  0000c6f1 ffffffff f56db2c8 ffffffc6 f56db3d8 ffffffc6 00000000 00000000
[   96.276704] Process kworker/1:0 (pid: 19, stack limit = 0xffffffc6f9160000)
[   96.276709] Call trace:
[   96.276715] Exception stack(0xffffffc6f9163810 to 0xffffffc6f9163940)
[   96.276721] 3800:                                   ffffffc6f56db3d8 0000000000000007
[   96.276726] 3820: ffffffc6f9163a48 0000000000000000 0000000000000000 ffffffc600000000
[   96.276732] 3840: 00000080c6ffffff 0000000000000001 0000000000000000 ffffffc6f9163880
[   96.276737] 3860: 000000000000ffff fffffffffffffdb0 0000000000000018 ffffffc6f9163880
[   96.276742] 3880: 0000000000000007 ffffffc6f56db3e0 0000000000000007 ffffff8b166a1e08
[   96.276748] 38a0: 0000000000021191 ffffffc6f56db000 ffffffc6f56db328 0000000000000080
[   96.276753] 38c0: 0000000000000007 0000000000000000 00000000000000a8 ffffffc6f9145b00
[   96.276758] 38e0: 0000000000000000 0000000000000010 0000000000000008 ffffffc6f91639e0
[   96.276764] 3900: ffffff8b1603be00 ffffffc6f9163940 ffffff8b1603d52c 0000000080c00145
[   96.276769] 3920: ffffffc65ed18100 ffffffc663109138 ffffffffffffffff ffffff8b1603ba64
[   96.276775] [<ffffff8b1603d52c>] htb_lookup_leaf+0xf4/0x188
[   96.276783] [<ffffff8b1602d774>] __qdisc_run+0x60/0x3e8
[   96.276793] [<ffffff8b15ff7f9c>] __dev_queue_xmit+0x3e4/0xcdc
[   96.276800] [<ffffff8b160093fc>] neigh_direct_output+0x18/0x20
[   96.276806] [<ffffff8b160bfee0>] ip_finish_output2+0x2f0/0x5ec
[   96.276811] [<ffffff8b160bfb18>] ip_finish_output+0x24c/0x324
[   96.276817] [<ffffff8b160c13b8>] ip_output+0x180/0x23c
[   96.276826] [<ffffff8b1611f8a8>] iptunnel_xmit+0x17c/0x278
[   96.276832] [<ffffff8b160a1ab8>] send4+0x380/0x578
[   96.276837] [<ffffff8b160a167c>] wg_socket_send_skb_to_peer+0x80/0x13c
[   96.276842] [<ffffff8b1609f018>] wg_packet_tx_worker+0x10c/0x3bc
[   96.276851] [<ffffff8b14ed7e24>] process_one_work+0x16c/0x4c4
[   96.276856] [<ffffff8b14ed7900>] worker_thread+0x410/0x6e4
[   96.276863] [<ffffff8b14ee20c4>] kthread+0x204/0x238
[   96.276872] [<ffffff8b14e82e80>] ret_from_fork+0x10/0x50
[   96.276880] Code: f94001b0 f90001f0 f94005af f94001f0 (f9400a10)
[   96.276887] ---[ end trace 3153190ecb656787 ]---

Obviously I broke something, but this fixes it for now and HTB is not
very performance-critical. There have been no panics within 1 hour of
rigorous mobile data testing along with WireGuard after this change was
made.

Signed-off-by: kdrag0n <[email protected]>
  • Loading branch information
kdrag0n committed Feb 18, 2019
1 parent d6ef1dd commit d3a642e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/sched/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ obj-$(CONFIG_NET_SCH_FQ) += sch_fq.o
obj-$(CONFIG_NET_SCH_HHF) += sch_hhf.o
obj-$(CONFIG_NET_SCH_PIE) += sch_pie.o

CFLAGS_sch_htb.o += $(DISABLE_LTO)

obj-$(CONFIG_NET_CLS_U32) += cls_u32.o
obj-$(CONFIG_NET_CLS_ROUTE4) += cls_route.o
obj-$(CONFIG_NET_CLS_FW) += cls_fw.o
Expand Down

0 comments on commit d3a642e

Please sign in to comment.