Petr Tesarik
08d2d00b29
/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 >
2014-02-15 11:51:02 -08:00
..
2014-01-29 11:47:18 +01:00
2014-01-24 15:51:02 -08:00
2014-01-25 13:18:00 -08:00
2014-01-30 17:20:32 -08:00
2014-01-31 08:38:18 -08:00
2014-01-08 13:44:29 -05:00
2014-01-31 15:15:13 -08:00
2014-01-30 11:40:10 -08:00
2014-02-15 11:51:02 -08:00
2014-01-28 18:44:53 -08:00
2014-01-31 21:04:01 -08:00
2014-02-07 15:40:17 -08:00
2014-01-31 09:23:52 -08:00
2014-01-29 17:02:24 +11:00
2014-01-23 18:49:36 -08:00
2014-01-29 11:48:23 +01:00
2014-01-29 20:27:23 -08:00
2014-01-20 12:10:27 -08:00
2014-01-17 14:57:29 -07:00
2014-01-09 09:53:30 +09:00
2014-01-20 01:11:13 +01:00
2014-01-27 21:02:40 -08:00
2014-01-23 18:49:36 -08:00
2014-01-29 20:49:12 -08:00
2014-01-31 09:31:14 -08:00
2014-02-07 15:40:17 -08:00
2014-02-02 17:59:07 +01:00
2014-01-29 19:56:20 -08:00
2014-01-28 23:35:09 -08:00
2014-01-24 15:51:02 -08:00
2014-01-22 21:21:55 -08:00
2014-01-31 15:31:23 -08:00
2014-01-24 17:17:30 -08:00
2014-01-29 20:00:13 -08:00
2014-01-31 14:59:28 -08:00
2014-01-25 11:17:34 -08:00
2014-01-28 18:53:01 -08:00
2014-01-27 21:11:26 -08:00
2014-01-23 16:36:53 -08:00
2014-02-07 15:40:17 -08:00
2014-01-31 09:31:14 -08:00
2014-01-23 16:37:04 -08:00
2014-01-30 11:19:05 -08:00
2014-01-25 13:19:10 -08:00
2014-02-14 18:53:58 -08:00
2014-01-26 11:00:41 -08:00
2014-01-30 20:04:09 -08:00
2014-01-30 18:44:44 -08:00
2014-01-09 01:27:20 +01:00
2014-01-25 11:17:34 -08:00
2014-01-20 16:05:23 -08:00
2014-02-01 10:24:31 -08:00
2014-01-22 16:39:28 -08:00
2014-01-25 11:17:34 -08:00
2014-01-23 18:45:38 -08:00
2014-01-29 20:06:01 -08:00
2014-01-12 23:48:18 +01:00
2014-01-25 11:17:34 -08:00
2014-01-15 14:51:22 -08:00
2014-01-27 08:15:51 -08:00
2014-01-25 13:19:10 -08:00
2014-01-23 19:11:50 -08:00
2014-01-31 08:37:32 -08:00
2014-01-28 23:38:23 -08:00
2014-01-31 15:31:23 -08:00
2014-01-29 16:53:55 +11:00
2014-01-30 17:20:32 -08:00
2014-02-01 10:29:59 -08:00
2014-01-31 15:31:23 -08:00
2014-01-24 17:13:49 -08:00
2014-01-30 17:20:32 -08:00
2014-01-29 16:53:55 +11:00
2014-01-27 21:11:26 -08:00
2014-01-31 15:31:23 -08:00
2014-02-07 15:40:17 -08:00
2014-01-22 22:24:35 -08:00
2014-01-23 16:36:55 -08:00
2014-02-08 13:30:43 -08:00
2014-01-28 21:35:40 +01:00
2014-01-31 08:38:18 -08:00