Andrey Ryabinin
e26c761f5a
ARM: 8320/1: fix integer overflow in ELF_ET_DYN_BASE
...
commit 8defb3367f upstream.
Usually ELF_ET_DYN_BASE is 2/3 of TASK_SIZE. With 3G/1G user/kernel
split this is not so, because 2*TASK_SIZE overflows 32 bits,
so the actual value of ELF_ET_DYN_BASE is:
(2 * TASK_SIZE / 3) = 0x2a000000
When ASLR is disabled PIE binaries will load at ELF_ET_DYN_BASE address.
On 32bit platforms AddressSanitzer uses addresses [0x20000000 - 0x40000000]
for shadow memory [1]. So ASan doesn't work for PIE binaries when ASLR disabled
as it fails to map shadow memory.
Also after Kees's 'split ET_DYN ASLR from mmap ASLR' patchset PIE binaries
has a high chance of loading somewhere in between [0x2a000000 - 0x40000000]
even if ASLR enabled. This makes ASan with PIE absolutely incompatible.
Fix overflow by dividing TASK_SIZE prior to multiplying.
After this patch ELF_ET_DYN_BASE equals to (for CONFIG_VMSPLIT_3G=y):
(TASK_SIZE / 3 * 2) = 0x7f555554
[1] https://code.google.com/p/address-sanitizer/wiki/AddressSanitizerAlgorithm#Mapping
Signed-off-by: Andrey Ryabinin <a.ryabinin@samsung.com >
Reported-by: Maria Guseva <m.guseva@samsung.com >
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2015-05-06 21:56:21 +02:00
..
2013-05-07 11:22:14 -07:00
2013-05-03 09:13:19 -07:00
2013-04-25 16:46:07 +00:00
2014-01-09 12:24:26 -08:00
2013-01-10 21:09:31 +00:00
2015-02-05 22:35:38 -08:00
2012-10-02 08:58:07 +02:00
2012-03-28 18:30:01 +01:00
2014-11-21 09:22:55 -08:00
2010-12-05 08:39:36 +00:00
2014-03-06 21:30:01 -08:00
2011-10-17 09:13:41 +01:00
2011-07-19 18:09:45 +02:00
2013-05-13 23:42:24 +01:00
2012-03-28 18:30:01 +01:00
2013-01-31 21:44:45 +01:00
2012-11-19 14:51:11 +00:00
2012-03-21 01:59:40 -04:00
2013-06-24 14:28:43 +01:00
2013-01-10 21:13:05 +00:00
2013-04-03 16:45:50 +01:00
2013-02-25 15:30:41 +01:00
2014-05-06 07:55:27 -07:00
2012-05-21 15:09:38 +02:00
2013-02-25 15:30:41 +01:00
2012-12-20 10:07:25 -08:00
2013-02-14 15:04:33 +01:00
2012-07-05 09:50:55 +01:00
2011-08-17 08:44:16 +01:00
2011-12-11 08:35:50 +00:00
2015-05-06 21:56:21 +02:00
2011-10-23 13:32:29 +01:00
2011-10-17 09:02:44 +01:00
2011-05-26 10:31:06 +01:00
2013-04-09 01:52:06 +09:00
2012-10-09 20:29:06 +02:00
2011-01-27 11:48:58 +00:00
2011-03-31 11:26:23 -03:00
2014-05-06 07:55:26 -07:00
2013-03-26 09:55:23 +00:00
2013-01-31 21:44:46 +01:00
2011-02-12 11:52:21 +00:00
2013-06-24 14:28:46 +01:00
2011-03-31 11:26:23 -03:00
2012-09-14 09:21:59 -05:00
2012-09-19 21:52:08 +01:00
2013-04-03 16:45:49 +01:00
2013-01-10 21:13:06 +00:00
2011-03-29 14:47:57 +02:00
2012-10-12 13:05:52 +01:00
2012-09-14 13:53:39 +00:00
2013-04-28 22:23:08 -07:00
2014-05-06 07:55:27 -07:00
2013-03-26 16:11:20 +00:00
2010-10-07 14:08:55 +01:00
2013-10-18 07:45:45 -07:00
2012-12-12 11:30:02 -08:00
2011-03-03 16:26:55 -05:00
2010-10-29 13:14:40 -05:00
2012-07-24 15:27:28 +08:00
2012-01-17 16:17:01 -05:00
2013-02-11 19:05:11 +00:00
2013-03-06 15:48:42 -08:00
2013-08-20 08:43:03 -07:00
2013-01-23 13:29:14 -05:00
2013-03-06 15:48:45 -08:00
2013-04-28 22:23:13 -07:00
2013-01-23 13:29:17 -05:00
2013-04-28 22:23:11 -07:00
2013-01-23 13:29:18 -05:00
2013-03-06 15:48:44 -08:00
2012-03-13 13:45:55 +00:00
2012-01-25 20:37:45 -06:00
2013-04-24 10:37:03 -04:00
2012-01-13 15:02:35 +00:00
2015-02-05 22:35:39 -08:00
2013-08-11 18:35:20 -07:00
2013-08-11 18:35:20 -07:00
2015-02-05 22:35:38 -08:00
2012-08-25 09:22:31 +01:00
2013-01-10 21:10:20 +00:00
2012-09-19 08:32:49 +01:00
2013-01-10 21:10:20 +00:00
2014-03-31 09:58:13 -07:00
2015-02-05 22:35:38 -08:00
2012-02-23 20:19:04 -07:00
2013-06-05 23:35:56 +01:00
2012-11-23 13:01:30 +00:00
2011-12-08 10:30:39 +00:00
2011-10-06 15:40:06 +01:00
2011-10-06 15:40:05 +01:00
2014-05-06 07:55:26 -07:00
2015-02-05 22:35:39 -08:00
2011-12-08 10:30:39 +00:00
2015-02-05 22:35:39 -08:00
2011-12-08 10:30:39 +00:00
2012-03-23 16:58:31 -07:00
2015-02-05 22:35:39 -08:00
2012-11-09 11:37:26 +00:00
2011-12-08 10:30:39 +00:00
2013-08-11 18:35:20 -07:00
2012-12-12 11:30:02 -08:00
2013-01-10 21:10:20 +00:00
2012-10-12 13:05:52 +01:00
2011-06-02 11:16:22 +01:00
2013-04-10 18:27:12 -05:00
2012-10-12 13:05:52 +01:00
2013-02-03 18:15:47 -05:00
2013-06-24 14:28:43 +01:00
2013-02-21 15:27:22 -08:00
2013-03-11 08:42:08 -05:00
2012-11-13 11:47:40 +00:00
2012-07-09 17:41:10 +01:00
2014-03-23 21:38:13 -07:00
2011-09-20 23:33:36 +01:00
2012-10-12 13:05:52 +01:00
2012-03-28 18:30:01 +01:00
2012-08-08 16:34:01 +00:00
2013-11-04 04:31:06 -08:00
2012-03-28 18:30:01 +01:00
2013-04-08 17:39:24 +02:00
2012-09-20 09:51:13 -04:00
2011-07-06 20:49:45 +01:00
2013-08-11 18:35:20 -07:00
2011-04-10 21:13:36 +01:00
2012-10-07 21:20:57 +09:00
2013-08-20 08:43:05 -07:00
2013-05-02 21:30:36 +01:00
2012-04-28 11:01:30 +01:00
2011-11-30 23:55:21 +00:00
2012-01-23 10:24:11 +00:00
2014-06-11 12:03:23 -07:00
2011-03-31 11:26:23 -03:00
2012-01-16 08:56:25 -06:00
2014-05-06 07:55:26 -07:00
2011-12-06 11:16:13 +00:00
2011-03-10 15:16:29 +00:00
2012-10-29 10:04:05 +00:00
2011-07-12 11:19:29 -05:00
2013-01-10 21:09:32 +00:00
2012-07-09 17:41:11 +01:00