[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8e156377-e7d9-48ec-a7ee-292aba002201@t-8ch.de>
Date: Sun, 26 Mar 2023 13:42:35 -0500 (EST)
From: Thomas Weißschuh <thomas@...ch.de>
To: Alexey Dobriyan <adobriyan@...il.com>
Cc: Willy Tarreau <w@....eu>,
Thomas Weißschuh <linux@...ssschuh.net>,
"Paul E. McKenney" <paulmck@...nel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/8] tools/nolibc: tests: add test for -fstack-protector
Mar 26, 2023 13:30:21 Alexey Dobriyan <adobriyan@...il.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?
Powered by blists - more mailing lists