• P
    serial: 8250: Validate reg addr for Au1x00/RT288x i/o accessors · 509cb7dc
    Peter Hurley 提交于
    Au1x00/RT2800+ hardware has an alternate register layout which is
    remapped with lookup tables by the au_serial_in()/out() i/o accessors.
    However, the h/w does not support the complete 8250 register set, and
    accesses to unmapped registers cause out-of-bounds lookups. Further,
    because the lookup tables are defined by designated initializers, the
    tables may contain unmapped entries (although the current tables do not).
    
    Declare fixed-size lookup tables with contiguous initialization for
    the complete 8250 register map; unmapped registers are initialized to -1.
    Validate the register index (ie., 'offset') is in the range [0, table size).
    Return fixed value for unmapped register reads and ignore unmapped register
    writes.
    Reported-by: NMason <slash.tmp@free.fr>
    Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
    Tested-by: NMans Rullgard <mans@mansr.com>
    Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    509cb7dc
8250_core.c 100.8 KB