Eric Dumazet
404ca80eb5
coredump: fix va_list corruption
A va_list needs to be copied in case it needs to be used twice.
Thanks to Hugh for debugging this issue, leading to various panics.
Tested:
lpq84:~# echo "|/foobar12345 %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h" >/proc/sys/kernel/core_pattern
'produce_core' is simply : main() { *(int *)0 = 1;}
lpq84:~# ./produce_core
Segmentation fault (core dumped)
lpq84:~# dmesg | tail -1
[ 614.352947] Core dump to |/foobar12345 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 lpq84 (null) pipe failed
Notice the last argument was replaced by a NULL (we were lucky enough to
not crash, but do not try this on your production machine !)
After fix :
lpq83:~# echo "|/foobar12345 %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h %h" >/proc/sys/kernel/core_pattern
lpq83:~# ./produce_core
Segmentation fault
lpq83:~# dmesg | tail -1
[ 740.800441] Core dump to |/foobar12345 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 lpq83 pipe failed
Fixes: 5fe9d8ca21cc ("coredump: cn_vprintf() has no reason to call vsnprintf() twice")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Diagnosed-by: Hugh Dickins <hughd@google.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: stable@vger.kernel.org # 3.11+
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-04-19 13:23:31 -07:00
..
2014-04-07 16:35:53 -07:00
2014-04-07 16:36:08 -07:00
2014-04-07 16:36:08 -07:00
2014-04-03 16:21:01 -07:00
2014-04-08 16:48:51 -07:00
2014-04-04 15:39:39 -07:00
2014-04-07 16:36:08 -07:00
2014-04-12 14:49:50 -07:00
2014-04-12 14:49:50 -07:00
2014-04-12 15:39:53 -07:00
2014-04-16 23:08:57 -05:00
2014-04-04 15:39:39 -07:00
2014-04-04 15:39:39 -07:00
2014-04-04 15:39:39 -07:00
2014-03-13 10:14:33 -04:00
2014-04-11 16:15:36 -04:00
2014-04-04 14:03:05 -07:00
2014-04-04 15:39:39 -07:00
2014-04-10 14:33:02 -07:00
2014-04-07 17:59:17 -07:00
2014-04-07 17:59:17 -07:00
2014-04-12 14:49:50 -07:00
2014-04-07 16:38:06 -07:00
2014-04-04 15:39:39 -07:00
2014-04-04 15:39:39 -07:00
2014-04-12 14:49:50 -07:00
2014-04-07 16:35:53 -07:00
2014-04-04 15:39:39 -07:00
2014-04-04 15:39:39 -07:00
2014-04-03 16:21:01 -07:00
2014-04-04 15:39:39 -07:00
2014-04-03 16:20:59 -07:00
2014-04-07 17:59:17 -07:00
2014-03-12 16:38:03 -04:00
2014-04-07 10:17:30 -07:00
2014-04-04 15:39:39 -07:00
2014-04-16 11:54:40 -07:00
2014-03-28 10:43:08 -04:00
2014-04-03 16:21:01 -07:00
2014-04-04 15:39:39 -07:00
2014-04-12 17:31:22 -07:00
2014-04-07 16:35:53 -07:00
2014-04-08 18:28:14 -07:00
2014-04-07 16:35:53 -07:00
2014-04-03 16:20:51 -07:00
2014-04-12 14:49:50 -07:00
2014-04-12 17:31:22 -07:00
2014-04-03 16:21:01 -07:00
2014-03-13 10:14:33 -04:00
2014-04-12 14:49:50 -07:00
2014-04-04 15:39:39 -07:00
2014-03-13 10:14:33 -04:00
2014-03-13 10:14:33 -04:00
2014-04-07 17:59:17 -07:00
2014-04-07 17:59:17 -07:00
2014-03-13 10:14:33 -04:00
2014-03-13 10:14:33 -04:00
2014-04-16 11:56:33 -07:00
2014-04-04 15:39:39 -07:00
2014-04-07 16:35:53 -07:00
2014-04-12 14:49:50 -07:00
2014-04-07 16:36:16 -07:00
2014-04-17 08:15:30 +10:00
2014-03-28 10:14:45 -04:00
2014-03-27 09:52:54 -07:00
2014-04-07 16:35:52 -07:00
2014-04-03 16:21:16 -07:00
2014-04-09 08:00:06 -06:00
2014-04-12 14:49:50 -07:00
2014-04-12 14:49:50 -07:00
2014-04-12 14:49:50 -07:00
2014-04-04 14:21:20 -07:00
2014-04-19 13:23:31 -07:00
2014-04-08 09:52:16 -07:00
2014-04-04 15:50:08 -07:00
2014-04-03 16:21:04 -07:00
2014-04-12 14:49:50 -07:00
2014-03-31 08:24:43 -04:00
2014-04-12 14:49:50 -07:00
2014-04-12 14:49:50 -07:00
2014-04-03 16:21:05 -07:00
2014-04-04 14:49:16 -07:00
2014-04-04 15:39:39 -07:00
2014-03-31 08:24:43 -04:00
2014-03-18 19:24:49 -04:00
2014-04-01 23:19:09 -04:00
2014-04-12 14:49:50 -07:00
2014-04-01 23:19:18 -04:00
2014-04-12 14:49:50 -07:00
2014-04-01 23:19:22 -04:00
2014-04-01 23:19:08 -04:00
2014-04-01 23:19:08 -04:00
2014-04-04 14:49:16 -07:00
2014-04-01 23:19:09 -04:00
2014-03-31 14:32:17 -07:00
2014-04-01 23:19:23 -04:00
2014-04-16 11:53:08 -07:00