The branch stable/13 has been updated by melifaro: URL: https://cgit.FreeBSD.org/src/commit/?id=d40def01a4f4fed65329f4a74792cad3134eeb29
commit d40def01a4f4fed65329f4a74792cad3134eeb29 Author: Alexander V. Chernikov <[email protected]> AuthorDate: 2021-05-14 16:03:08 +0000 Commit: Alexander V. Chernikov <[email protected]> CommitDate: 2021-05-30 10:30:53 +0000 Fix a use after free in update_rtm_from_rc(). update_rtm_from_rc() calls update_rtm_from_info() internally. The latter one may update provided prtm pointer with a new rtm. Reassign rtm from prtm afeter calling update_rtm_from_info() to avoid touching the freed rtm. PR: 255871 Submitted by: [email protected] --- sys/net/rtsock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c index 6930bd167ac1..3cb645f42e4c 100644 --- a/sys/net/rtsock.c +++ b/sys/net/rtsock.c @@ -976,6 +976,7 @@ update_rtm_from_rc(struct rt_addrinfo *info, struct rt_msghdr **prtm, if ((error = update_rtm_from_info(info, prtm, alloc_len)) != 0) return (error); + rtm = *prtm; rtm->rtm_flags = rc->rc_rt->rte_flags | nhop_get_rtflags(nh); if (rtm->rtm_flags & RTF_GWFLAG_COMPAT) rtm->rtm_flags = RTF_GATEWAY | _______________________________________________ [email protected] mailing list https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all To unsubscribe, send any mail to "[email protected]"
