Skip to content

Commit

Permalink
fix: failed byte off relocation (iov_iter.iov)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmat11 committed Oct 10, 2023
1 parent f2581d8 commit 3101fb6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions GPL/Events/Process/Probe.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,12 @@ static int tty_write__enter(struct kiocb *iocb, struct iov_iter *from)
}

const struct iovec *iov;
if (FIELD_OFFSET(iov_iter, __iov)) {
if (FIELD_OFFSET(iov_iter, __iov))
iov = (const struct iovec *)((char *)from + FIELD_OFFSET(iov_iter, __iov));
} else {
else if (bpf_core_field_exists(from->iov))
iov = BPF_CORE_READ(from, iov);
}
else
goto out;

u64 nr_segs = BPF_CORE_READ(from, nr_segs);
nr_segs = nr_segs > MAX_NR_SEGS ? MAX_NR_SEGS : nr_segs;
Expand Down

0 comments on commit 3101fb6

Please sign in to comment.