|
|
Message-ID: <d51c2fb1-3674-8df3-b0a5-65e5e3c0ad59@redhat.com>
Date: Mon, 26 Feb 2018 13:51:27 -0800
From: Laura Abbott <labbott@...hat.com>
To: alex.popov@...ux.com, Kees Cook <keescook@...omium.org>,
kernel-hardening@...ts.openwall.com
Cc: Will Deacon <will.deacon@....com>, richard.sandiford@....com
Subject: Re: [PATCH 2/2] gcc-plugins: stackleak: Update for gcc-8
On 02/24/2018 06:04 AM, Alexander Popov wrote:
> Hello Laura,
>
> Thanks for the cooperation!
>
> On 23.02.2018 02:14, Laura Abbott wrote:
>> +#if BUILDING_GCC_VERSION >= 8000
>> +bool check_frame_size()
>> +{
>> + return maybe_ge(get_frame_size(), track_frame_size);
>
> After looking through this guide
> https://gcc.gnu.org/onlinedocs//gccint/Guidelines-for-using-poly_005fint.html#Guidelines-for-using-poly_005fint
> it seems to me that we should better use something like that:
>
> poly_int64 frame_size = get_frame_size();
>
> if (frame_size.to_constant() >= track_frame_size)
> return 0;
>
> May I ask for your opinion?
>
I was a bit wary of using to_constant() because I wasn't 100% sure
I could make the assertion that it could actually be a constant so using
maybe_ge seemed like the conservative approach. This also getting into
compiler internals so it's possible I'm misunderstanding how poly_ints
are supposed to work.
Thanks,
Laura
>> +}
>> +#else
>> +bool check_frame_size()
>> +{
>> + return get_frame_size() >= track_frame_size;
>> +}
>> +#endif
>> /*
>> * Work with the RTL representation of the code.
>> * Remove the unneeded track_stack() calls from the functions which don't
>> @@ -215,7 +237,7 @@ static unsigned int stackleak_final_execute(void)
>> if (cfun->calls_alloca)
>> return 0;
>>
>> - if (get_frame_size() >= track_frame_size)
>> + if (check_frame_size())
>> return 0;
>>
>
> Best regards,
> Alexander
>
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.