[HN Gopher] GCC's new fortification level: The gains and costs
       ___________________________________________________________________
        
       GCC's new fortification level: The gains and costs
        
       Author : pjmlp
       Score  : 49 points
       Date   : 2022-09-18 15:47 UTC (7 hours ago)
        
 (HTM) web link (developers.redhat.com)
 (TXT) w3m dump (developers.redhat.com)
        
       | Animats wrote:
       | _" Strictly speaking, the C standards prohibit using a pointer to
       | an object after its lifetime ends. It should neither be read nor
       | dereferenced. In this context, it is a bug in the application.
       | However, this idiom is commonly used by developers to prevent
       | making redundant copies."_
       | 
       | I thought that hack was dead and buried. It won't work in debug
       | modes where buffers are zeroed in "free".
       | 
       | Fear of copying time is usually misplaced. The PDP-11 is gone.
       | Unless you're copying megabytes, the copy time of recently
       | accessed in-cache data is very small.
        
       | ruuda wrote:
       | This link shows a blank page with red text "Sorry, you need to
       | enable JavaScript to visit this website." But when I scroll on
       | mobile, a little extra space appears due to the url bar scrolling
       | out of view, and in that space, I can see a glimpse of the full
       | article itself rendering just fine, only it's unusable because of
       | this anti-disable-Javascript overlay blocking the view :(
        
         | turminal wrote:
         | Even with javascript enabled it looks awful on mobile.
        
       | saagarjha wrote:
       | Unfortunately not much in the way of performance measurements :(
        
         | siddhesh wrote:
         | It's on my TODO list. Watch out for Fedora change proposals for
         | (hopefully) Fedora 38.
        
           | gavinray wrote:
           | What if you develop inside of a Fedora 38 Docker container
           | FROM quay.io/fedora/fedora:38       RUN dnf install -y <bunch
           | of tools>
           | 
           | Got any useful tips or flags to enable that're bleeding edge?
        
       | dwheeler wrote:
       | Which Linux distributions are planning to use this new
       | fortification level, and in what circumstances?
       | 
       | I can imagine enabling this in programs that directly interact
       | with the internet, e.g., web browsers, email clients, and
       | resolver libraries. I can imagine Debian, Ubuntu, and Red Hat
       | enabling it. It would especially make sense for Tails, at least
       | in some cases. But that doesn't mean it will _happen_. I 'd love
       | to hear more.
        
         | siddhesh wrote:
         | OpenSUSE already enables it across the distribution; they were
         | the first to do it. I believe Gentoo either already has or is
         | in the process of doing it. I'll make a proposal for Fedora
         | once I have a better idea of the code size and performance
         | impact.
        
       | gavinray wrote:
       | Very cool
       | 
       | From the previous article linked at the footer of this one:
       | 
       | - https://developers.redhat.com/blog/2021/04/16/broadening-com...
       | 
       | It says that this is available in LLVM                 GCC
       | support for __builtin_dynamic_object_size or equivalent
       | functionality is in progress. At the moment this is available
       | only when building applications with LLVM. There are some
       | unspecified corner cases with __builtin_dynamic_object_size that
       | may result in avoidable performance overheads. We hope to iron
       | those out with the GCC implementation and feed it back into LLVM,
       | thus making both implementations consistent and performant.
       | 
       | Does this mean I can set this flag in Clang and it'll work?
        
       ___________________________________________________________________
       (page generated 2022-09-18 23:01 UTC)