From: "Thomas Weißschuh " <thomas@t-8ch.de>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Willy Tarreau" <w@1wt.eu>,
"Thomas Weißschuh" <linux@weissschuh.net>,
"Paul E. McKenney" <paulmck@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/8] tools/nolibc: tests: add test for -fstack-protector
Date: Sun, 26 Mar 2023 13:42:35 -0500 (EST) [thread overview]
Message-ID: <8e156377-e7d9-48ec-a7ee-292aba002201@t-8ch.de> (raw)
In-Reply-To: <89a960c7-0c9b-43ab-9fc8-a68405f7ed6a@p183>
Mar 26, 2023 13:30:21 Alexey Dobriyan <adobriyan@gmail.com>:
> Willy Tarreau wrote:
>> #if defined(__clang__)
>> __attribute__((optnone))
>> #elif defined(__GNUC__)
>> __attribute__((optimize("O0")))
>> #endif
>> static int smash_stack(void)
>> {
>> char buf[100];
>>
>> for (size_t i = 0; i < 200; i++)
>> buf[i] = 'P';
>>
>> return 1;
>> }
>
> If you want to corrupt the stack, corrupt the stack!
I do!
> asm(
> ".globl f\n"
> "f:\n"
> "movq $0, (%rsp)\n"
> "ret\n"
> ".type f,@function\n"
> ".size f,.-f"
> );
> > No problems with optimisation levels.
Wouldn't this be architecture-specific?
next prev parent reply other threads:[~2023-03-26 18:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-26 18:30 Alexey Dobriyan
2023-03-26 18:42 ` Thomas Weißschuh [this message]
2023-03-26 18:45 ` Willy Tarreau
2023-03-26 19:38 ` Alexey Dobriyan
2023-03-26 19:42 ` Willy Tarreau
2023-03-27 15:32 ` Alexey Dobriyan
2023-03-27 15:54 ` Willy Tarreau
2023-03-27 23:20 ` Thomas Weißschuh
2023-03-28 4:59 ` Willy Tarreau
-- strict thread matches above, loose matches on Subject: below --
2023-03-25 15:45 [PATCH 0/8] tools/nolibc: add support for stack protector Willy Tarreau
2023-03-25 15:45 ` [PATCH 6/8] tools/nolibc: tests: add test for -fstack-protector Willy Tarreau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8e156377-e7d9-48ec-a7ee-292aba002201@t-8ch.de \
--to=thomas@t-8ch.de \
--cc=adobriyan@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=paulmck@kernel.org \
--cc=w@1wt.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®