Skip to content

Instantly share code, notes, and snippets.

@nevermosby
Created May 24, 2020 06:29
Show Gist options
  • Save nevermosby/a182727870adb7cacb5d81a3570ce869 to your computer and use it in GitHub Desktop.
Save nevermosby/a182727870adb7cacb5d81a3570ce869 to your computer and use it in GitHub Desktop.
bpf program only can be loaded into kernel if the program contains inlined function
Disassembly of section tc:
tc_drop_tcp:
0: bf 16 00 00 00 00 00 00 r6 = r1
1: b7 01 00 00 00 00 00 00 r1 = 0
2: 73 1a f4 ff 00 00 00 00 *(u8 *)(r10 - 12) = r1
3: b7 01 00 00 69 6f 6e 0a r1 = 175009641
4: 63 1a f0 ff 00 00 00 00 *(u32 *)(r10 - 16) = r1
5: 18 01 00 00 20 74 63 20 00 00 00 00 73 65 63 74 r1 = 8386658476233028640 ll
7: 7b 1a e8 ff 00 00 00 00 *(u64 *)(r10 - 24) = r1
8: 18 01 00 00 45 6e 74 65 00 00 00 00 72 69 6e 67 r1 = 7453010373394067013 ll
10: 7b 1a e0 ff 00 00 00 00 *(u64 *)(r10 - 32) = r1
11: bf a1 00 00 00 00 00 00 r1 = r10
12: 07 01 00 00 e0 ff ff ff r1 += -32
13: b7 02 00 00 15 00 00 00 r2 = 21
14: 85 00 00 00 06 00 00 00 call 6
15: 61 61 50 00 00 00 00 00 r1 = *(u32 *)(r6 + 80)
16: 61 68 4c 00 00 00 00 00 r8 = *(u32 *)(r6 + 76)
17: bf 82 00 00 00 00 00 00 r2 = r8
18: 07 02 00 00 0e 00 00 00 r2 += 14
19: 2d 12 54 00 00 00 00 00 if r2 > r1 goto +84 <LBB1_4>
20: 71 82 0c 00 00 00 00 00 r2 = *(u8 *)(r8 + 12)
21: 71 83 0d 00 00 00 00 00 r3 = *(u8 *)(r8 + 13)
22: 67 03 00 00 08 00 00 00 r3 <<= 8
23: 4f 23 00 00 00 00 00 00 r3 |= r2
24: 55 03 4f 00 08 00 00 00 if r3 != 8 goto +79 <LBB1_4>
25: b7 00 00 00 00 00 00 00 r0 = 0
26: bf 82 00 00 00 00 00 00 r2 = r8
27: 07 02 00 00 22 00 00 00 r2 += 34
28: 2d 12 4c 00 00 00 00 00 if r2 > r1 goto +76 <LBB1_5>
29: 61 86 1e 00 00 00 00 00 r6 = *(u32 *)(r8 + 30)
30: 61 87 1a 00 00 00 00 00 r7 = *(u32 *)(r8 + 26)
31: 18 01 00 00 61 64 64 72 00 00 00 00 2e 2e 2e 0a r1 = 733574566330524769 ll
33: 7b 1a f0 ff 00 00 00 00 *(u64 *)(r10 - 16) = r1
34: 18 01 00 00 72 69 6e 74 00 00 00 00 20 69 70 20 r1 = 2337483794718550386 ll
36: 7b 1a e8 ff 00 00 00 00 *(u64 *)(r10 - 24) = r1
37: 18 01 00 00 74 72 79 20 00 00 00 00 74 6f 20 70 r1 = 8079580276054389364 ll
39: 7b 1a e0 ff 00 00 00 00 *(u64 *)(r10 - 32) = r1
40: b7 09 00 00 00 00 00 00 r9 = 0
41: 73 9a f8 ff 00 00 00 00 *(u8 *)(r10 - 8) = r9
42: bf a1 00 00 00 00 00 00 r1 = r10
43: 07 01 00 00 e0 ff ff ff r1 += -32
44: b7 02 00 00 19 00 00 00 r2 = 25
45: 85 00 00 00 06 00 00 00 call 6
46: 18 01 00 00 2e 25 64 2e 00 00 00 00 25 64 0a 00 r1 = 2924860621989166 ll
48: 7b 1a f0 ff 00 00 00 00 *(u64 *)(r10 - 16) = r1
49: 18 01 00 00 64 64 72 31 00 00 00 00 3a 20 25 64 r1 = 7216209412240860260 ll
51: 7b 1a e8 ff 00 00 00 00 *(u64 *)(r10 - 24) = r1
52: 18 01 00 00 73 72 63 20 00 00 00 00 69 70 20 61 r1 = 6998717417751016051 ll
54: 7b 1a e0 ff 00 00 00 00 *(u64 *)(r10 - 32) = r1
55: bf 74 00 00 00 00 00 00 r4 = r7
56: 77 04 00 00 08 00 00 00 r4 >>= 8
57: 57 04 00 00 ff 00 00 00 r4 &= 255
58: bf 73 00 00 00 00 00 00 r3 = r7
59: 57 03 00 00 ff 00 00 00 r3 &= 255
60: 77 07 00 00 10 00 00 00 r7 >>= 16
61: 57 07 00 00 ff 00 00 00 r7 &= 255
62: bf a1 00 00 00 00 00 00 r1 = r10
63: 07 01 00 00 e0 ff ff ff r1 += -32
64: b7 02 00 00 18 00 00 00 r2 = 24
65: bf 75 00 00 00 00 00 00 r5 = r7
66: 85 00 00 00 06 00 00 00 call 6
67: 73 9a f8 ff 00 00 00 00 *(u8 *)(r10 - 8) = r9
68: 18 01 00 00 64 2e 25 64 00 00 00 00 2e 25 64 0a r1 = 748764319229226596 ll
70: 7b 1a f0 ff 00 00 00 00 *(u64 *)(r10 - 16) = r1
71: 18 01 00 00 61 64 64 72 00 00 00 00 31 3a 20 25 r1 = 2675202162705065057 ll
73: 7b 1a e8 ff 00 00 00 00 *(u64 *)(r10 - 24) = r1
74: bf 64 00 00 00 00 00 00 r4 = r6
75: 77 04 00 00 08 00 00 00 r4 >>= 8
76: 57 04 00 00 ff 00 00 00 r4 &= 255
77: bf 65 00 00 00 00 00 00 r5 = r6
78: 77 05 00 00 10 00 00 00 r5 >>= 16
79: 57 05 00 00 ff 00 00 00 r5 &= 255
80: 18 07 00 00 64 65 73 74 00 00 00 00 20 69 70 20 r7 = 2337483794718877028 ll
82: 7b 7a e0 ff 00 00 00 00 *(u64 *)(r10 - 32) = r7
83: bf 63 00 00 00 00 00 00 r3 = r6
84: 57 03 00 00 ff 00 00 00 r3 &= 255
85: bf a1 00 00 00 00 00 00 r1 = r10
86: 07 01 00 00 e0 ff ff ff r1 += -32
87: b7 02 00 00 19 00 00 00 r2 = 25
88: 85 00 00 00 06 00 00 00 call 6
89: b7 01 00 00 25 64 0a 00 r1 = 680997
90: 63 1a f0 ff 00 00 00 00 *(u32 *)(r10 - 16) = r1
91: 18 01 00 00 61 64 64 72 00 00 00 00 32 3a 20 2e r1 = 3323720513341383777 ll
93: 7b 1a e8 ff 00 00 00 00 *(u64 *)(r10 - 24) = r1
94: 7b 7a e0 ff 00 00 00 00 *(u64 *)(r10 - 32) = r7
95: 77 06 00 00 18 00 00 00 r6 >>= 24
96: bf a1 00 00 00 00 00 00 r1 = r10
97: 07 01 00 00 e0 ff ff ff r1 += -32
98: b7 02 00 00 14 00 00 00 r2 = 20
99: bf 63 00 00 00 00 00 00 r3 = r6
100: 85 00 00 00 06 00 00 00 call 6
101: b7 00 00 00 02 00 00 00 r0 = 2
102: 71 81 17 00 00 00 00 00 r1 = *(u8 *)(r8 + 23)
103: 15 01 01 00 06 00 00 00 if r1 == 6 goto +1 <LBB1_5>
LBB1_4:
104: b7 00 00 00 00 00 00 00 r0 = 0
LBB1_5:
105: 95 00 00 00 00 00 00 00 exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment