You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Translation of user space addresses requires that we know which process
to use for the translation. We have been prefacing the address to
translate like this:
/* Preface the value with the user process tgid. */
emit(dlp, BPF_CALL_HELPER(BPF_FUNC_get_current_pid_tgid));
emit(dlp, BPF_ALU64_IMM(BPF_AND, BPF_REG_0, 0xffffffff));
One problem is that the IMM "and" operation is a no-op. The 0xffffffff
is promoted to a 64-bit -1, leading to no %r0 bits changing. Another
problem is that we are pulling out the tgid. This means that the
translation will fail. Further, even if the consumer knew which part
of the pid_tgid combination to use for address translation, keys for
aggregations could fail spuriously due to different tgids for the same
process.
Convert to
/* Preface the value with the user process pid. */
emit(dlp, BPF_CALL_HELPER(BPF_FUNC_get_current_pid_tgid));
emit(dlp, BPF_ALU64_IMM(BPF_RSH, BPF_REG_0, 32));
Also, in the umod test (which uncovered this problem), add ld-*.so to
the list of shared objects we're going to skip.
Signed-off-by: Eugene Loh <[email protected]>
Reviewed-by: Kris Van Hees <[email protected]>
0 commit comments