This error was found with FORTIFY_SOURCE, and it's a real problem. I'm able to crash the syslogd with enabled FORTIFY_SOURCE.
The problem is the broken pointer usage in strlcpy, which renders the strlcpy's check unusable.
Obtained from HardenedBSD.
Differential D3254
Fix buffer overflow in syslogd, wall and talkd. op on Jul 30 2015, 9:24 PM. Authored by Tags None Referenced Files
Subscribers
Details This error was found with FORTIFY_SOURCE, and it's a real problem. I'm able to crash the syslogd with enabled FORTIFY_SOURCE. Obtained from HardenedBSD.
Diff Detail
Event TimelineComment Actions I'm fine w/ this change.
Comment Actions Change looks fine to me. I agree with jmg@ that there is no reason that device should be static because the pointer is strictly internal to the function unlike errbuf would be returned, but I think that can go in a different changeset. Comment Actions Thank you ... will commit soon and MFC after 3 days. Question: should I try to fold this into the release? Comment Actions It would be nice, but not must have. If there isn't another exploitable bug, whereby able to write to the utmpx related db files (these requires root access or setuid), the attacker could not exploit this bug. The only way to control the line (ut->ut_line) is through the utmpx files. Comment Actions OK, honestly it is rather tight schedule to push fixes into Release, and that's why I prefer not to go that way.. Comment Actions And, of course, Bruce did some post-commit review, to let us know this wasn't the best possible fix.
|