926ede Rework cpu affinity parsing

13 files Authored by Zbigniew Jędrzejewski-Szmek 4 years ago, Committed by Packit Service 4 years ago,
    Rework cpu affinity parsing
    
    The CPU_SET_S api is pretty bad. In particular, it has a parameter for the size
    of the array, but operations which take two (CPU_EQUAL_S) or even three arrays
    (CPU_{AND,OR,XOR}_S) still take just one size. This means that all arrays must
    be of the same size, or buffer overruns will occur. This is exactly what our
    code would do, if it received an array of unexpected size over the network.
    ("Unexpected" here means anything different from what cpu_set_malloc() detects
    as the "right" size.)
    
    Let's rework this, and store the size in bytes of the allocated storage area.
    
    The code will now parse any number up to 8191, independently of what the current
    kernel supports. This matches the kernel maximum setting for any architecture,
    to make things more portable.
    
    Fixes #12605.
    
    (cherry picked from commit 0985c7c4e22c8dbbea4398cf3453da45ebf63800)
    
    Related: #1734787
    
    patch_name: 0272-Rework-cpu-affinity-parsing.patch
    present_in_specfile: true
    location_in_specfile: 272
    squash_commits: true
    
        
file modified
+108 -25
file modified
+32 -15
file modified
+10 -25
file modified
+6 -6
file modified
+2 -2
file modified
+1 -30
file modified
+8 -6
file modified
+2 -31
file modified
+2 -2
file modified
+12 -17
file modified
+2 -2
file modified
+98 -81
file modified
+3 -0