summaryrefslogtreecommitdiff
path: root/drivers/fmc
diff options
context:
space:
mode:
authorPetr Tesarik <ptesarik@suse.cz>2014-01-30 09:48:02 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-15 11:51:02 -0800
commit08d2d00b291ed4eb91530050274e67a761c1901d (patch)
tree89099e1078b50ff770f06a86106edc72dc52563f /drivers/fmc
parent1bc9fac3da9aa7569e70e9fda605281ef7e42b9f (diff)
/dev/mem: handle out-of-bounds read/write
The loff_t type may be wider than phys_addr_t (e.g. on 32-bit systems). Consequently, the file offset may be truncated in the assignment. Currently, /dev/mem wraps around, which may cause applications to read or write incorrect regions of memory by accident. Let's follow POSIX file semantics here and return 0 when reading from and -EFBIG when writing to an offset that cannot be represented by a phys_addr_t. Note that the conditional is optimized out by the compiler if loff_t has the same size as phys_addr_t. Signed-off-by: Petr Tesarik <ptesarik@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/fmc')
0 files changed, 0 insertions, 0 deletions