Skip to content
Commit b59889bf authored by Pratyush Yadav's avatar Pratyush Yadav Committed by Simon Glass
Browse files

regmap: Check for out-of-range offsets before mapping them



In regmap_raw_{read,write}_range(), offsets are checked to make sure
they aren't out of range. But this check happens _after_ the address is
mapped from physical memory. Input should be sanity-checked before using
it. Mapping the address before validating it leaves the door open to
passing an invalid address to map_physmem(). So check for out of range
offsets _before_ mapping them.

This fixes a segmentation fault in sandbox when -1 is used as an offset
to regmap_{read,write}().

Signed-off-by: default avatarPratyush Yadav <p.yadav@ti.com>
parent 42a768c6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment