Skip to content
  • Richard Henderson's avatar
    a05cee93
    linux-user: Use ARRAY_SIZE with bitmask_transtbl · a05cee93
    Richard Henderson authored
    
    
    Rather than using a zero tuple to end the table, use a macro
    to apply ARRAY_SIZE and pass that on to the convert functions.
    
    This fixes two bugs in which the conversion functions required
    that both the target and host masks be non-zero in order to
    continue, rather than require both target and host masks be
    zero in order to terminate.
    
    This affected mmap_flags_tbl when the host does not support
    all of the flags we wish to convert (e.g. MAP_UNINITIALIZED).
    Mapping these flags to zero is good enough, and matches how
    the kernel ignores bits that are unknown.
    
    Fixes: 4b840f96 ("linux-user: Populate more bits in mmap_flags_tbl")
    Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
    Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
    a05cee93
    linux-user: Use ARRAY_SIZE with bitmask_transtbl
    Richard Henderson authored
    
    
    Rather than using a zero tuple to end the table, use a macro
    to apply ARRAY_SIZE and pass that on to the convert functions.
    
    This fixes two bugs in which the conversion functions required
    that both the target and host masks be non-zero in order to
    continue, rather than require both target and host masks be
    zero in order to terminate.
    
    This affected mmap_flags_tbl when the host does not support
    all of the flags we wish to convert (e.g. MAP_UNINITIALIZED).
    Mapping these flags to zero is good enough, and matches how
    the kernel ignores bits that are unknown.
    
    Fixes: 4b840f96 ("linux-user: Populate more bits in mmap_flags_tbl")
    Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
    Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
Loading