Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the use of -fno-stack-protector?

I have written an application in C, and I'm trying to understand what is the purpose of the -fno-stack-protector command when compiling. For my specific application, it makes no difference if I use this command or not in terms of protecting against buffer overflow.

I've read online that the -fstack-protector and -fno-stack-protector commands enable and disable respectively the stack-smashing protector, but if I'm compiling the application myself, how can the protector be enabled beforehand? Does the usage of the command maybe depend on what system the application is running on?

like image 839
touvlo2000 Avatar asked May 23 '12 03:05

touvlo2000


People also ask

What is the use of semicolon?

A semicolon has two general uses: to clarify a series and to indicate two closely related sentences. Series—If one or more elements in a series contain a comma, use semicolons to separate them. Include a semicolon before the final conjunction.

How do you use a colon and semicolon?

Colons and semicolons are two types of punctuation. Colons (:) are used in sentences to show that something is following, like a quotation, example, or list. Semicolons (;) are used to join two independent clauses, or two complete thoughts that could stand alone as complete sentences.

How do you use dashes?

Use dashes to mark the beginning and end of a series, which might otherwise get confused, with the rest of the sentence: Example: The three female characters—the wife, the nun, and the jockey—are the incarnation of excellence. Dashes are also used to mark the interruption of a sentence in dialogue: Example: “Help!

How is a semicolon used in a sentence?

A semicolon may be used between independent clauses joined by a connector, such as and, but, or, nor, etc., when one or more commas appear in the first clause. Example: When I finish here, and I will soon, I'll be glad to help you; and that is a promise I will keep.


1 Answers

In the standard/stock GCC, stack protector is off by default. However, some Linux distributions have patched GCC to turn it on by default. In my opinion, this is rather harmful, as it breaks the ability to compile anything that's not linked against the standard userspace libraries unless the Makefile specifically disables stack protector. It would even break the Linux kernel build except that the distributions with this hack added additional hacks to GCC to detect that the kernel is being built and disable it.

like image 160
R.. GitHub STOP HELPING ICE Avatar answered Oct 21 '22 13:10

R.. GitHub STOP HELPING ICE