Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 23 Oct 2018 16:20:39 +0200
From: Florian Weimer <>
To: Solar Designer <>
Cc:,  Andrew Sandoval <>
Subject: Re: GCC Compiler Induced Vulnerability - affects programs compiled with GCC 7 and 8 containing nested functions

* Solar Designer:

> 3. Andrew writes: "Most if not all C++ compilers are able to produce
> code from lambdas (similar to nested functions) without compromising the
> call stack."  It'd be helpful to explore this more and see whether
> there's any fundamental difference preventing reuse of the same approach
> (whatever it is) for nested functions as well.  I'd appreciate
> discussion of this on oss-security.  My guess is this probably doesn't
> fit in the existing ABI for C, but I might be wrong.

std::function in C++ isn't just a code pointer.  It's more like a
function descriptor on some architectures, so you don't need to generate
a trampoline because the called code can load ancilarry information
(such as the static chain pointer or other information to access
captured variables), without having to encode this in the pointer

There are other ways to produce trampolines which do not need an
executable stack, and even ways that avoid code generation at run time
(such as pre-cooked array of trampoline code that gets mapped multiple
times as needed).


Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.