Skip to content

Commit

Permalink
pf: Avoid CHERI crashes due to an inocent OOB access of to-be-discard…
Browse files Browse the repository at this point in the history
…ed memory
  • Loading branch information
RoundofThree committed Dec 29, 2024
1 parent f201118 commit 29703da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sys/netpfil/pf/pf_norm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1478,10 +1478,10 @@ pf_normalize_tcp(struct pfi_kkif *kif, struct mbuf *m, int ipoff,
(tcp_get_flags(th) & (TH_RES1|TH_RES2|TH_RES2)) != 0) {
u_int16_t ov, nv;

ov = *(u_int16_t *)(&th->th_ack + 1);
ov = *(u_int16_t *)(__unbounded_addressof(th->th_ack) + 1);
flags &= ~(TH_RES1 | TH_RES2 | TH_RES3);
tcp_set_flags(th, flags);
nv = *(u_int16_t *)(&th->th_ack + 1);
nv = *(u_int16_t *)(__unbounded_addressof(th->th_ack) + 1);

th->th_sum = pf_proto_cksum_fixup(m, th->th_sum, ov, nv, 0);
rewrite = 1;

Check warning on line 1487 in sys/netpfil/pf/pf_norm.c

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
Expand Down

0 comments on commit 29703da

Please sign in to comment.