Skip to content

Commit 73b877d

Browse files
committed
link: disable uprobe tests on v4.9
Running v4.9 in vimto, trying to create a perf event via perf_event_open returns EIO. I've tracked this down to a check in uprobe_register: if (!inode->i_mapping->a_ops->readpage && !shmem_mapping(inode->i_mapping)) return -EIO; See https://elixir.bootlin.com/linux/v4.9.337/source/kernel/events/uprobes.c#L880 My hunch is that this is related to how vimto sets up the overlayfs mount: if the probed binary is below the overlayfs the setup fails. Instead of fixing vimto, stop testing these code paths on v4.9. That kernel is already EOL so there is not much use in investing more time. Signed-off-by: Lorenz Bauer <[email protected]>
1 parent a65f3dc commit 73b877d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

link/uprobe_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ func TestExecutableOffset(t *testing.T) {
6969
}
7070

7171
func TestExecutableLazyLoadSymbols(t *testing.T) {
72+
testutils.SkipOnOldKernel(t, "4.14", "uprobe on v4.9 returns EIO on vimto")
73+
7274
ex, err := OpenExecutable("/bin/bash")
7375
qt.Assert(t, qt.IsNil(err))
7476
// Addresses must be empty, will be lazy loaded.
@@ -93,6 +95,8 @@ func TestExecutableLazyLoadSymbols(t *testing.T) {
9395
}
9496

9597
func TestUprobe(t *testing.T) {
98+
testutils.SkipOnOldKernel(t, "4.14", "uprobe on v4.9 returns EIO on vimto")
99+
96100
prog := mustLoadProgram(t, ebpf.Kprobe, 0, "")
97101

98102
up, err := bashEx.Uprobe(bashSym, prog, nil)
@@ -113,6 +117,8 @@ func TestUprobeExtNotFound(t *testing.T) {
113117
}
114118

115119
func TestUprobeExtWithOpts(t *testing.T) {
120+
testutils.SkipOnOldKernel(t, "4.14", "uprobe on v4.9 returns EIO on vimto")
121+
116122
prog := mustLoadProgram(t, ebpf.Kprobe, 0, "")
117123

118124
// NB: It's not possible to invoke the uprobe since we use an arbitrary
@@ -128,6 +134,8 @@ func TestUprobeExtWithOpts(t *testing.T) {
128134
}
129135

130136
func TestUprobeWithPID(t *testing.T) {
137+
testutils.SkipOnOldKernel(t, "4.14", "uprobe on v4.9 returns EIO on vimto")
138+
131139
prog := mustLoadProgram(t, ebpf.Kprobe, 0, "")
132140

133141
up, err := bashEx.Uprobe(bashSym, prog, &UprobeOptions{PID: os.Getpid()})
@@ -148,6 +156,8 @@ func TestUprobeWithNonExistentPID(t *testing.T) {
148156
}
149157

150158
func TestUretprobe(t *testing.T) {
159+
testutils.SkipOnOldKernel(t, "4.14", "uprobe on v4.9 returns EIO on vimto")
160+
151161
prog := mustLoadProgram(t, ebpf.Kprobe, 0, "")
152162

153163
up, err := bashEx.Uretprobe(bashSym, prog, nil)
@@ -214,6 +224,8 @@ func TestUprobePMUUnavailable(t *testing.T) {
214224

215225
// Test tracefs u(ret)probe creation on all kernel versions.
216226
func TestUprobeTraceFS(t *testing.T) {
227+
testutils.SkipOnOldKernel(t, "4.14", "uprobe on v4.9 returns EIO on vimto")
228+
217229
// Fetch the offset from the /bin/bash Executable already defined.
218230
off, err := bashEx.address(bashSym, 0, 0)
219231
qt.Assert(t, qt.IsNil(err))
@@ -265,6 +277,8 @@ func TestUprobeTraceFS(t *testing.T) {
265277
}
266278

267279
func TestUprobeProgramCall(t *testing.T) {
280+
testutils.SkipOnOldKernel(t, "4.14", "uprobe on v4.9 returns EIO on vimto")
281+
268282
tests := []struct {
269283
name string
270284
elf string
@@ -345,6 +359,8 @@ func TestUprobeProgramCall(t *testing.T) {
345359
}
346360

347361
func TestUprobeProgramWrongPID(t *testing.T) {
362+
testutils.SkipOnOldKernel(t, "4.14", "uprobe on v4.9 returns EIO on vimto")
363+
348364
m, p := newUpdaterMapProg(t, ebpf.Kprobe, 0)
349365

350366
// Load the '/bin/bash' executable.

0 commit comments

Comments
 (0)