Xi Wang
6d92d4f6a7
fs/exec.c: work around icc miscompilation
...
The tricky problem is this check:
if (i++ >= max)
icc (mis)optimizes this check as:
if (++i > max)
The check now becomes a no-op since max is MAX_ARG_STRINGS (0x7FFFFFFF).
This is "allowed" by the C standard, assuming i++ never overflows,
because signed integer overflow is undefined behavior. This
optimization effectively reverts the previous commit 362e6663ef23
("exec.c, compat.c: fix count(), compat_count() bounds checking") that
tries to fix the check.
This patch simply moves ++ after the check.
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: Jason Baron <jbaron@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-01-11 14:54:55 -08:00
..
2012-10-12 09:59:23 +09:00
2012-12-20 14:00:01 -05:00
2012-12-20 14:00:01 -05:00
2012-10-02 20:25:04 -07:00
2012-12-17 15:44:47 -08:00
2012-10-02 20:25:04 -07:00
2012-12-20 14:00:01 -05:00
2012-12-20 18:14:31 -08:00
2012-12-20 22:34:00 +00:00
2012-12-20 14:00:13 -08:00
2013-01-01 23:04:30 -06:00
2012-10-02 21:35:55 -04:00
2012-12-17 17:15:12 -08:00
2012-09-21 03:13:08 -07:00
2012-11-15 17:46:42 -08:00
2012-10-22 16:50:13 -07:00
2012-11-16 11:20:42 -06:00
2012-12-18 10:10:13 -06:00
2012-10-02 20:25:04 -07:00
2012-12-14 12:17:32 +02:00
2012-12-20 14:04:11 -08:00
2012-10-09 23:23:53 +02:00
2012-12-17 17:15:12 -08:00
2013-01-06 23:40:25 -05:00
2013-01-03 11:41:43 -08:00
2012-12-20 17:40:20 -08:00
2012-10-02 20:25:04 -07:00
2012-12-20 22:35:15 +00:00
2012-12-17 20:58:12 -08:00
2013-01-02 10:05:27 +00:00
2012-12-20 14:00:01 -05:00
2012-12-20 20:00:43 -08:00
2012-10-10 11:15:20 +09:00
2012-12-20 18:40:00 -05:00
2012-11-19 05:59:09 -08:00
2012-12-13 12:00:02 -08:00
2012-10-09 23:33:55 -04:00
2012-12-13 12:00:02 -08:00
2013-01-02 09:57:34 -08:00
2012-11-18 11:59:01 +02:00
2012-12-20 18:40:52 -05:00
2012-11-04 14:43:40 -05:00
2012-12-20 18:40:53 -05:00
2012-12-20 18:40:53 -05:00
2012-12-20 18:40:54 -05:00
2013-01-05 14:26:51 -05:00
2012-12-21 17:07:45 -08:00
2012-12-20 18:40:54 -05:00
2012-06-01 19:51:22 -07:00
2012-12-20 20:11:52 -08:00
2012-12-20 18:40:55 -05:00
2012-12-20 14:00:01 -05:00
2012-12-20 14:00:01 -05:00
2012-10-02 21:35:55 -04:00
2013-01-02 09:27:10 -08:00
2013-01-03 15:57:14 -08:00
2012-10-02 20:25:04 -07:00
2012-10-02 20:25:04 -07:00
2012-12-13 16:33:24 +01:00
2012-07-14 16:34:47 +04:00
2012-12-20 14:00:01 -05:00
2012-10-02 21:35:55 -04:00
2012-10-02 20:25:04 -07:00
2012-12-17 15:44:47 -08:00
2012-12-20 14:00:01 -05:00
2012-12-17 17:15:26 -08:00
2012-12-13 16:33:23 +01:00
2012-12-20 14:00:01 -05:00
2012-12-03 12:10:59 -06:00
2012-07-22 23:57:59 +04:00
2012-03-20 21:29:45 -04:00
2012-11-20 04:17:24 -08:00
2012-12-17 17:15:12 -08:00
2012-11-28 21:53:38 -05:00
2012-11-28 21:53:38 -05:00
2012-12-17 17:15:19 -08:00
2012-12-17 17:15:23 -08:00
2012-11-28 21:53:38 -05:00
2012-12-20 17:40:19 -08:00
2012-12-20 17:40:19 -08:00
2012-11-28 21:53:38 -05:00
2012-09-09 10:35:38 +02:00
2012-10-22 22:00:26 +02:00
2012-12-17 17:15:12 -08:00
2012-12-12 17:38:35 -08:00
2012-10-22 08:50:37 +03:00
2012-10-06 03:05:17 +09:00
2012-10-29 09:00:57 -07:00
2012-10-12 20:14:55 -04:00
2012-11-29 00:01:25 -05:00
2012-10-06 03:05:15 +09:00
2012-12-20 18:49:10 -05:00
2012-02-28 19:31:58 -05:00
2012-11-29 12:38:44 -08:00
2012-12-17 17:15:27 -08:00
2013-01-02 09:16:43 -08:00
2013-01-11 14:54:55 -08:00
2012-10-09 15:52:31 +09:00
2012-12-20 14:04:11 -08:00
2012-07-16 08:33:14 -07:00
2012-12-20 13:57:36 -05:00
2013-01-03 15:57:16 -08:00
2012-10-12 20:14:55 -04:00
2012-11-28 21:49:02 -05:00
2012-12-12 17:38:34 -08:00
2012-09-18 01:01:35 -07:00
2012-12-11 17:22:26 -08:00
2012-11-26 17:41:24 -08:00
2012-09-26 22:20:08 -04:00
2012-05-30 08:52:42 -07:00
2012-12-20 13:54:52 -08:00
2012-10-06 03:05:15 +09:00
2012-12-20 18:46:29 -05:00
2012-10-09 18:35:22 -04:00
2012-12-11 13:43:42 +09:00
2012-11-20 04:19:49 -08:00
2012-02-28 19:31:58 -05:00
2012-12-20 18:50:05 -05:00
2012-12-20 13:36:18 -05:00
2012-12-20 18:50:07 -05:00
2012-09-26 21:08:52 -04:00
2012-07-14 16:37:27 +04:00
2012-11-19 05:59:20 -08:00
2012-09-18 01:01:35 -07:00
2012-07-14 16:32:48 +04:00
2012-12-20 17:40:21 -08:00
2012-10-02 21:35:55 -04:00
2012-09-26 22:20:08 -04:00
2012-09-26 22:20:08 -04:00
2013-01-10 14:35:24 -08:00
2012-12-17 17:15:27 -08:00
2013-01-06 20:58:13 -08:00
2012-02-28 19:31:58 -05:00
2012-12-20 18:50:01 -05:00
2012-12-20 18:50:07 -05:00
2012-10-09 23:33:39 -04:00
2012-09-26 22:20:08 -04:00
2012-09-26 22:20:08 -04:00
2012-12-20 18:50:08 -05:00
2012-10-12 13:16:48 -07:00
2012-12-20 18:50:11 -05:00