HomeFreeBSD

Fix a use after free in update_rtm_from_rc().

Description

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: lylgood@foxmail.com
MFC after: 3 days

Details

Provenance
melifaroAuthored on May 14 2021, 4:03 PM
Parents
rG852088f6af6c: vfs: add missing atomic conversion to writecount adjustment
Branches
Unknown
Tags
Unknown