tijl
f0c5e71226
- Fix two possible overflows when testing if ELF program headers are on
...
the first page:
1. Cast uint16_t operands in a multiplication to unsigned int because
otherwise the implicit promotion to int results in a signed
multiplication that can overflow and the behaviour on integer
overflow is undefined.
2. Replace (offset + size > PAGE_SIZE) with (size > PAGE_SIZE - offset)
because the sum may overflow.
- Use the same tests to see if the path to the interpreter is on the first
page. There's no overflow here because size is already limited by
MAXPATHLEN, but the compiler optimises the new tests better. Also fix an
off-by-one error.
- Simplify tests to see if an ELF note program header is on the first page.
This also fixes an off-by-one error.
Reviewed by: kib
MFC after: 1 week
2013-03-13 22:01:31 +00:00
..
2012-08-21 18:13:09 +00:00
2013-03-02 21:11:30 +00:00
2012-08-15 15:42:57 +00:00
2012-09-25 19:16:28 +00:00
2012-07-22 13:41:45 +00:00
2013-03-13 22:01:31 +00:00
2012-06-28 07:33:43 +00:00
2011-03-06 22:59:30 +00:00
2013-02-02 11:58:35 +00:00
2013-03-02 21:12:54 +00:00
2012-10-22 17:50:54 +00:00
2012-10-22 17:50:54 +00:00
2013-03-05 10:18:48 +00:00
2013-03-04 11:09:56 +00:00
2013-03-04 12:20:48 +00:00
2012-12-22 13:33:28 +00:00
2012-10-06 19:50:23 +00:00
2011-09-16 13:58:51 +00:00
2012-03-10 18:56:16 +00:00
2012-08-30 21:22:47 +00:00
2012-10-22 17:50:54 +00:00
2013-03-03 23:25:45 +00:00
2011-11-07 06:44:47 +00:00
2012-08-14 19:16:30 +00:00
2013-03-13 06:42:01 +00:00
2013-03-09 09:07:13 +00:00
2013-03-02 14:48:41 +00:00
2013-03-02 00:53:12 +00:00
2011-11-07 06:44:47 +00:00
2011-12-01 07:19:13 +00:00
2013-03-02 00:53:12 +00:00
2012-10-22 17:50:54 +00:00
2011-04-13 11:28:46 +00:00
2011-05-31 21:22:44 +00:00
2013-03-04 11:22:19 +00:00
2012-12-18 18:34:36 +00:00
2011-04-12 08:13:18 +00:00
2012-05-26 20:03:47 +00:00
2013-02-08 07:29:07 +00:00
2012-10-22 17:50:54 +00:00
2012-10-22 17:50:54 +00:00
2013-01-06 21:47:59 +00:00
2011-11-07 06:44:47 +00:00
2011-09-16 13:58:51 +00:00
2013-02-04 09:35:48 +00:00
2013-01-17 21:28:31 +00:00
2013-02-02 14:19:50 +00:00
2012-08-22 20:01:57 +00:00
2012-12-22 09:37:34 +00:00
2012-08-16 02:35:44 +00:00
2010-11-25 20:05:11 +00:00
2012-03-28 20:58:30 +00:00
2011-11-07 15:43:11 +00:00
2012-12-18 07:36:45 +00:00
2013-02-20 12:03:20 +00:00
2012-11-14 10:33:12 +00:00
2012-11-15 15:55:49 +00:00
2012-05-30 16:06:38 +00:00
2012-10-26 16:01:08 +00:00
2013-03-07 02:53:29 +00:00
2012-12-22 09:37:34 +00:00
2012-12-22 09:37:34 +00:00
2012-03-27 15:07:43 +00:00
2013-02-20 12:03:20 +00:00
2013-02-20 10:38:34 +00:00
2013-02-21 21:59:35 +00:00
2012-12-09 04:54:22 +00:00
2012-12-22 09:37:34 +00:00
2013-03-12 06:58:49 +00:00
2010-10-21 20:31:50 +00:00
2013-03-01 18:49:14 +00:00
2013-03-04 11:09:56 +00:00
2012-05-26 20:03:47 +00:00
2013-02-19 16:35:27 +00:00
2013-03-12 06:58:49 +00:00
2013-03-10 22:55:35 +00:00
2013-03-09 15:31:19 +00:00
2012-01-05 19:00:36 +00:00
2012-08-10 18:19:57 +00:00
2012-10-22 17:50:54 +00:00
2012-10-22 17:50:54 +00:00
2012-10-18 12:04:56 +00:00
2011-03-01 13:28:27 +00:00
2011-11-21 01:26:10 +00:00
2011-09-16 13:58:51 +00:00
2011-07-17 23:05:24 +00:00
2012-10-26 16:01:08 +00:00
2012-11-15 14:10:51 +00:00
2012-04-17 14:54:00 +00:00
2012-03-13 20:27:48 +00:00
2011-01-06 22:09:37 +00:00
2013-02-05 20:08:33 +00:00
2013-02-12 16:57:20 +00:00
2013-01-23 14:37:05 +00:00
2012-12-20 00:34:54 +00:00
2011-01-09 14:34:56 +00:00
2012-07-11 18:50:50 +00:00
2012-06-22 07:06:40 +00:00
2012-06-25 05:41:16 +00:00
2012-01-23 16:31:46 +00:00
2012-09-04 23:16:55 +00:00
2012-04-12 17:43:59 +00:00
2011-11-15 20:11:03 +00:00
2012-11-15 00:51:57 +00:00
2013-03-04 16:07:55 +00:00
2012-12-05 08:04:20 +00:00
2011-02-09 19:08:21 +00:00
2012-03-19 00:36:32 +00:00
2013-03-09 01:39:42 +00:00
2011-11-07 06:44:47 +00:00
2011-10-16 14:16:46 +00:00
2011-11-07 15:43:11 +00:00
2012-05-31 17:27:05 +00:00
2011-11-19 14:10:16 +00:00
2011-08-19 08:29:10 +00:00
2012-01-26 16:35:09 +00:00
2013-03-12 06:58:49 +00:00
2012-12-19 20:08:06 +00:00
2011-11-16 19:06:55 +00:00
2012-12-28 06:52:53 +00:00
2012-11-20 15:33:48 +00:00
2013-03-01 22:03:31 +00:00
2013-02-17 21:37:32 +00:00
2013-02-20 12:03:20 +00:00
2012-09-14 21:28:56 +00:00
2013-03-09 10:16:08 +00:00
2013-03-02 00:53:12 +00:00
2013-03-09 09:07:13 +00:00
2013-02-17 11:48:16 +00:00
2012-11-13 12:52:31 +00:00
2013-02-26 01:00:11 +00:00
2011-08-16 20:07:47 +00:00
2013-03-02 21:12:54 +00:00
2013-03-02 21:11:30 +00:00
2013-03-02 21:12:54 +00:00
2011-09-16 13:58:51 +00:00
2011-09-16 13:58:51 +00:00
2013-02-20 12:03:20 +00:00
2012-02-06 18:15:46 +00:00
2012-01-02 12:12:10 +00:00
2011-06-26 18:26:20 +00:00
2012-11-18 15:48:34 +00:00
2011-01-04 10:59:38 +00:00
2012-10-25 09:05:21 +00:00
2013-03-02 00:53:12 +00:00
2011-02-25 10:11:01 +00:00
2013-03-02 21:11:30 +00:00
2012-12-05 08:04:20 +00:00
2013-03-12 13:42:47 +00:00
2013-03-02 00:53:12 +00:00
2013-03-02 00:53:12 +00:00
2013-03-02 14:48:41 +00:00
2012-12-05 08:04:20 +00:00
2013-03-11 17:43:55 +00:00
2013-03-12 12:15:24 +00:00
2013-03-11 22:59:07 +00:00
2013-02-06 15:18:46 +00:00
2013-03-02 14:48:41 +00:00
2013-02-27 18:17:34 +00:00
2012-10-22 17:50:54 +00:00
2013-02-21 21:54:53 +00:00
2013-03-02 14:48:41 +00:00
2013-02-21 21:59:35 +00:00
2012-10-22 17:50:54 +00:00
2013-01-14 05:41:40 +00:00
2013-02-21 02:41:37 +00:00
2013-03-02 00:53:12 +00:00
2013-01-04 11:11:12 +00:00
2012-12-04 20:49:04 +00:00
2013-02-20 12:03:20 +00:00
2013-03-02 14:48:41 +00:00
2013-03-02 14:48:41 +00:00
2012-11-22 10:36:10 +00:00