This is an archive of the discontinued LLVM Phabricator instance.

[Docs] Expand -fstack-protector and -fstack-protector-all info
ClosedPublic

Authored by carwil on Dec 7 2018, 5:15 AM.

Details

Summary

Improve the description of these command line options by providing specific heuristic information, as outlined for the ssp function attribute(s) in LLVM's documentation.

Diff Detail

Repository
rL LLVM

Event Timeline

carwil created this revision.Dec 7 2018, 5:15 AM

Please linewrap to 80 col.

carwil updated this revision to Diff 177239.Dec 7 2018, 9:30 AM

Edited Options.td directly, rather than the generated docs file.

thopre added inline comments.Dec 10 2018, 3:50 AM
include/clang/Driver/Options.td
1634–1636 ↗(On Diff #177239)

I'm not sure what's the policy for related options but I feel the description should stand on its own. I'd therefor start by:

"Enable stack protectors for some functions potentially vulnerable to stack smashing. Compared to -fstack-protector, this uses a stronger heuristic (....)"

If the policy is to avoid such repeatition then please ignore this comment.

1638 ↗(On Diff #177239)

Not a native english speaker but I feel that "potentially" is redundant given you said it enables stack protector for *some* functions. Perhaps rewrite it along the lines of:

"Enable stack protectors for some of the functions vulnerable to stack smashing based on simple heuristic"

with a better word than "simple". This conveys both that not all functions are protected and suggests that a better heuristic is possible. You can then easily refer the reader to -fstack-protector-strong and -fstack-protector-all in a following sentence.

carwil updated this revision to Diff 177668.Dec 11 2018, 12:43 AM

Make thopre's suggested changes.

carwil marked 2 inline comments as done.Dec 11 2018, 12:44 AM
thopre added inline comments.Dec 11 2018, 5:15 AM
include/clang/Driver/Options.td
1636 ↗(On Diff #177668)

May I suggest to change it to "Enable stack protectors for all functions" for consistency with below entries? Rest LGTM otherwise.

carwil updated this revision to Diff 177828.Dec 12 2018, 2:09 AM
carwil marked an inline comment as done.

Reworded -fstack-protector-all to bring it in line with the changes to the other two options.

thopre accepted this revision.Dec 12 2018, 2:12 AM

LGTM. Thanks!

This revision is now accepted and ready to land.Dec 12 2018, 2:12 AM
This revision was automatically updated to reflect the committed changes.