Page MenuHomeFreeBSD

rtsock: fix panic in rtsock_msg_buffer()
ClosedPublic

Authored by glebius on Nov 18 2024, 8:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Oct 3, 7:16 AM
Unknown Object (File)
Sep 6 2026, 10:24 AM
Unknown Object (File)
Sep 3 2026, 8:22 AM
Unknown Object (File)
Sep 1 2026, 8:26 PM
Unknown Object (File)
Aug 26 2026, 10:05 PM
Unknown Object (File)
Aug 21 2026, 10:00 AM
Unknown Object (File)
Aug 18 2026, 4:21 PM
Unknown Object (File)
Aug 10 2026, 1:51 PM
Subscribers

Details

Summary

The rtsock_msg_buffer() can be called without walkarg, just to calculate
required length. It can also be called with a degenerate walkarg, that
doesn't have a w_req. The latter happens when the function is called from
update_rtm_from_info() for the second time.

Zero init walkarg in update_rtm_from_info() and don't pass random stack
garbage as w_req.

In rtsock_msg_buffer() initialize compat32 boolean only once and take of
possible empty w_req. Simplify the rest of code once compat32 is already
set.

Reported-by: syzbot+d4a2682059e23179e76e@syzkaller.appspotmail.com
Reported-by: syzbot+66d7c9b3062e27a56f3f@syzkaller.appspotmail.com

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 60667
Build 57551: arc lint + arc unit