• Ondrej Mosnacek's avatar
    selinux: don't produce incorrect filename_trans_count · 9521eb3e
    Ondrej Mosnacek authored
    I thought I fixed the counting in filename_trans_read_helper() to count
    the compat rule count correctly in the final version, but it's still
    wrong. To really count the same thing as in the compat path, we'd need
    to add up the cardinalities of stype bitmaps of all datums.
    
    Since the kernel currently doesn't implement an ebitmap_cardinality()
    function (and computing the proper count would just waste CPU cycles
    anyway), just document that we use the field only in case of the old
    format and stop updating it in filename_trans_read_helper().
    
    Fixes: 43005902 ("selinux: implement new format of filename transitions")
    Signed-off-by: default avatarOndrej Mosnacek <omosnace@redhat.com>
    Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
    9521eb3e
policydb.c 74.8 KB