Skip to content

Commit 269375a

Browse files
committed
kmods: fixup
1 parent 4a30137 commit 269375a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pyplugins/interventions/kmods.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ def init_module(self, regs, proto, syscall, module_image, size, param_values):
3030
# Check args for .ko file
3131
matching_ko = [arg for arg in args if arg.endswith('.ko')]
3232
if any(matching_ko):
33-
self.logger.info(f"Detected kernel module load: {matching_ko[-1]}")
3433
self.track_kmod(matching_ko[-1])
3534
return
35+
if any(arg for arg in args if arg.endswith('modprobe')):
36+
self.logger.info(f"modprobe detected, cannot determine module path from args: {args}")
37+
return
3638

3739
# Check open fds for .ko file
3840
fds = yield from plugins.osi.get_fds()
39-
for fd, fdname in fds.items():
41+
for i in range(len(fds)):
42+
fdname = fds[i].name
4043
if fdname.endswith('.ko'):
4144
self.track_kmod(fdname)
4245
return

0 commit comments

Comments
 (0)