97955f3 siggen: Fix insufficent entropy in sigtask file names

2 files Authored by Joshua Watt 2 years ago, Committed by Richard Purdie 2 years ago,
    siggen: Fix insufficent entropy in sigtask file names
    
    Signature generation uses mkstemp() to get a file descriptor to a unique
    file and then write the signature into it. However, the unique file name
    generation in glibc is based on the system timestamp, which means that
    with highly parallel builds it is more likely than one might expect
    expected that a conflict will occur between two different builder nodes.
    When operating over NFS (such as a shared sstate cache), this can cause
    race conditions and rare failures (particularly with NFS servers that
    may not correctly implement O_EXCL).
    
    The signature generation code is particularly susceptible to races since
    a single "sigtask." prefix used for all signatures from all tasks, which
    makes collision even more likely.
    
    To work around this, add an internal implementation of mkstemp() that
    adds additional truly random entropy to the file name to eliminate
    conflicts.
    
    Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
    Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
    
        
file modified
+1 -1
file modified
+21 -0