[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d4e653e7-1f23-eec9-4db7-964298fc1dc5@linux.alibaba.com>
Date: Mon, 27 Sep 2021 18:49:16 +0800
From: Lai Jiangshan <laijs@...ux.alibaba.com>
To: Borislav Petkov <bp@...en8.de>,
Lai Jiangshan <jiangshanlai@...il.com>
Cc: linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>, Joerg Roedel <jroedel@...e.de>,
Javier Martinez Canillas <javierm@...hat.com>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Brijesh Singh <brijesh.singh@....com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Arvind Sankar <nivedita@...m.mit.edu>,
Juergen Gross <jgross@...e.com>, Chester Lin <clin@...e.com>
Subject: Re: [PATCH V2 02/41] x86/traps: Remove stack-protector from traps.c
On 2021/9/27 18:19, Borislav Petkov wrote:
> On Sun, Sep 26, 2021 at 11:07:59PM +0800, Lai Jiangshan wrote:
>> diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
>> index 8f4e8fa6ed75..0e054e2304c6 100644
>> --- a/arch/x86/kernel/Makefile
>> +++ b/arch/x86/kernel/Makefile
>> @@ -48,6 +48,9 @@ KCOV_INSTRUMENT := n
>>
>> CFLAGS_head$(BITS).o += -fno-stack-protector
>>
>> +CFLAGS_REMOVE_traps.o = -fstack-protector -fstack-protector-strong
>
> Why this too?
>
>> +CFLAGS_traps.o += -fno-stack-protector
>
> Isn't this enough to disable stack protector for this file?
>
I did not investigate deep enough. I reviewed the generated code and
found %gs is accessed early for the C entry function and searched for
solution and I chose to copy the code that I thought is the most complete:
kernel/entry/Makefile
Using only "-fno-stack-protector" is enough to disable stack protector with
my .config, I'm not so sure about other configuration.
Thanks
Lai
Powered by blists - more mailing lists