From: Peter Hurley Date: Mon, 9 Mar 2015 18:05:00 +0000 (-0400) Subject: serial: 8250: Validate reg addr for Au1x00/RT288x i/o accessors X-Git-Tag: omap-for-v4.2/o2_dc~64^2~39 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=509cb7dc07cc03c28c7995a9213a605c04675a58;p=pandora-kernel.git serial: 8250: Validate reg addr for Au1x00/RT288x i/o accessors 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: Mason Signed-off-by: Peter Hurley Tested-by: Mans Rullgard Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed