This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Fix taint rule of fgets and setproctitle_init
ClosedPublic

Authored by steakhal on Feb 7 2022, 4:20 AM.

Details

Summary

There was a typo in the rule.
{{0}, ReturnValueIndex} meant that the discrete index is 0 and the
variadic index is -1.
What we wanted instead is that both 0 and -1 are in the discrete index
list.

Instead of this, we wanted to express that both 0 and the
ReturnValueIndex is in the discrete arg list.

The manual inspection revealed that setproctitle_init also suffered a
probably incomplete propagation rule.

Diff Detail

Event Timeline

steakhal created this revision.Feb 7 2022, 4:20 AM
steakhal requested review of this revision.Feb 7 2022, 4:20 AM
Szelethus accepted this revision.EditedFeb 8 2022, 1:31 AM

LGTM! Unrelated to this review, I don't think the term 'sink' is good in a warning message, are users expected to know what that is?

Choked on my coffee reading this:

AUTHORS
Peter Wemm ⟨peter@FreeBSD.org⟩ stole the idea from the Sendmail 8.7.3 source code by Eric Allman ⟨eric@sendmail.org⟩.

This revision is now accepted and ready to land.Feb 8 2022, 1:31 AM
gamesh411 accepted this revision.Feb 8 2022, 1:37 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2022, 7:57 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript