-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathissues.go
More file actions
126 lines (97 loc) · 3.99 KB
/
issues.go
File metadata and controls
126 lines (97 loc) · 3.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
// Copyright 2024 Leon Hwang.
// SPDX-License-Identifier: Apache-2.0
package main
import (
"fmt"
"io"
"github.com/fatih/color"
)
const (
issueStateNotExists = "not exists"
issueStateFixed = "fixed"
issueStateNotFixed = "not fixed"
issueStateCannotDetect = "cannot detect"
)
type tailcallIssue struct {
name string
commit string
commitTitle string
commitURL string
patchURL string
fixedKernelVersion string
sinceKernelVersion string
requiredBpf2bpf bool
requiredFreplace bool
}
var tailcallIssueInvalidOffset = tailcallIssue{
name: "invalid loading offset of tail_call_cnt for bpf2bpf",
commit: "ff672c67ee76",
commitTitle: "bpf, x86: Fix tail call count offset calculation on bpf2bpf call",
commitURL: "https://github.com/torvalds/linux/commit/ff672c67ee7635ca1e28fb13729e8ef0d1f08ce5",
patchURL: "https://lore.kernel.org/bpf/20220616162037.535469-1-jakub@cloudflare.com/",
fixedKernelVersion: "v5.19",
sinceKernelVersion: "v5.10",
requiredBpf2bpf: true,
}
var tailcallIssueInfiniteLoopCausedByTrampoline = tailcallIssue{
name: "tailcall infinite loop caused by trampoline",
commit: "2b5dcb31a19a",
commitTitle: "bpf, x64: Fix tailcall infinite loop",
commitURL: "https://github.com/torvalds/linux/commit/2b5dcb31a19a2e0acd869b12c9db9b2d696ef544",
patchURL: "https://lore.kernel.org/bpf/20230912150442.2009-1-hffilwlqm@gmail.com/",
fixedKernelVersion: "v6.7",
sinceKernelVersion: "v5.10",
requiredBpf2bpf: true,
}
var tailcallIssueHierarchy = tailcallIssue{
name: "tailcall hierarchy",
commit: "116e04ba1459",
commitTitle: "bpf, x64: Fix tailcall hierarchy",
commitURL: "https://github.com/torvalds/linux/commit/116e04ba1459fc08f80cf27b8c9f9f188be0fcb2",
patchURL: "https://lore.kernel.org/bpf/20240714123902.32305-1-hffilwlqm@gmail.com/",
fixedKernelVersion: "v6.12",
sinceKernelVersion: "v5.10",
requiredBpf2bpf: true,
}
var tailcallIssueInfiniteLoopCausedByFreplace = tailcallIssue{
name: "tailcall infinite loop caused by freplace",
commit: "d6083f040d5d",
commitTitle: "bpf: Prevent tailcall infinite loop caused by freplace",
commitURL: "https://github.com/torvalds/linux/commit/d6083f040d5d8f8d748462c77e90547097df936e",
patchURL: "https://lore.kernel.org/bpf/20241015150207.70264-1-leon.hwang@linux.dev/",
fixedKernelVersion: "v6.13",
sinceKernelVersion: "v6.2",
requiredBpf2bpf: true,
requiredFreplace: true,
}
var tailcallIssuePanicCausedByUpdatingAttachedFreplaceProgToProgArray = tailcallIssue{
name: "panic caused by updating attached freplace prog to prog array",
commit: "fdad456cbcca",
commitTitle: "bpf: Fix updating attached freplace prog in prog_array map",
commitURL: "https://github.com/torvalds/linux/commit/fdad456cbcca739bae1849549c7a999857c56f88",
patchURL: "https://lore.kernel.org/bpf/20240728114612.48486-1-leon.hwang@linux.dev/",
fixedKernelVersion: "v6.11",
sinceKernelVersion: "v6.2",
requiredFreplace: true,
}
var tailcallIssueInvalidTailcallee = tailcallIssue{
name: "invalid tailcallee",
commit: "1c123c567fb1",
commitTitle: "bpf: Resolve fext program type when checking map compatibility",
commitURL: "https://github.com/torvalds/linux/commit/1c123c567fb138ebd187480b7fc0610fcb0851f5",
patchURL: "https://lore.kernel.org/all/20221214230254.790066-1-toke@redhat.com/",
fixedKernelVersion: "v6.2",
sinceKernelVersion: "v5.6",
requiredFreplace: true,
}
func printIssueDetails(w io.Writer, issue *tailcallIssue) {
fmt.Fprintf(w, "ISSUE:\t%s\n", color.RedString(issue.name))
fmt.Fprintf(w, "COMMIT:\t%s (\"%s\")\n", issue.commit, issue.commitTitle)
fmt.Fprintf(w, "URL:\t%s\n", issue.commitURL)
fmt.Fprintf(w, "PATCH:\t%s\n", issue.patchURL)
fmt.Fprintf(w, "RANGE:\t%s -> %s\n", issue.sinceKernelVersion, issue.fixedKernelVersion)
}
func printIssueState(w io.Writer, issue *tailcallIssue, state string, cl *color.Color) {
fmt.Fprintf(w, "issue:\t%s\n", color.RedString(issue.name))
fmt.Fprintf(w, "state:\t%s\n", cl.Sprint(state))
}