Skip to content

Commit 0074250

Browse files
author
Alexei Starovoitov
committed
Merge branch 'bpf-streams-fixes'
Kumar Kartikeya Dwivedi says: ==================== BPF Streams - Fixes This set contains some fixes for recently reported issues for BPF streams. Please check individual patches for details. ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
2 parents 6e5cae9 + bfa2bb9 commit 0074250

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

kernel/bpf/core.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3244,6 +3244,7 @@ int bpf_prog_get_file_line(struct bpf_prog *prog, unsigned long ip, const char *
32443244
struct bpf_line_info *linfo;
32453245
void **jited_linfo;
32463246
struct btf *btf;
3247+
int nr_linfo;
32473248

32483249
btf = prog->aux->btf;
32493250
linfo = prog->aux->linfo;
@@ -3258,8 +3259,9 @@ int bpf_prog_get_file_line(struct bpf_prog *prog, unsigned long ip, const char *
32583259

32593260
insn_start = linfo[0].insn_off;
32603261
insn_end = insn_start + len;
3262+
nr_linfo = prog->aux->nr_linfo - prog->aux->linfo_idx;
32613263

3262-
for (int i = 0; i < prog->aux->nr_linfo &&
3264+
for (int i = 0; i < nr_linfo &&
32633265
linfo[i].insn_off >= insn_start && linfo[i].insn_off < insn_end; i++) {
32643266
if (jited_linfo[i] >= (void *)ip)
32653267
break;

kernel/bpf/stream.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,11 +498,11 @@ static bool dump_stack_cb(void *cookie, u64 ip, u64 sp, u64 bp)
498498
if (ret < 0)
499499
goto end;
500500
ctxp->err = bpf_stream_stage_printk(ctxp->ss, "%pS\n %s @ %s:%d\n",
501-
(void *)ip, line, file, num);
501+
(void *)(long)ip, line, file, num);
502502
return !ctxp->err;
503503
}
504504
end:
505-
ctxp->err = bpf_stream_stage_printk(ctxp->ss, "%pS\n", (void *)ip);
505+
ctxp->err = bpf_stream_stage_printk(ctxp->ss, "%pS\n", (void *)(long)ip);
506506
return !ctxp->err;
507507
}
508508

0 commit comments

Comments
 (0)