Eric Dumazet
286c72deab
udp: must lock the socket in udp_disconnect()
...
Baozeng Ding reported KASAN traces showing uses after free in
udp_lib_get_port() and other related UDP functions.
A CONFIG_DEBUG_PAGEALLOC=y kernel would eventually crash.
I could write a reproducer with two threads doing :
static int sock_fd;
static void *thr1(void *arg)
{
for (;;) {
connect(sock_fd, (const struct sockaddr *)arg,
sizeof(struct sockaddr_in));
}
}
static void *thr2(void *arg)
{
struct sockaddr_in unspec;
for (;;) {
memset(&unspec, 0, sizeof(unspec));
connect(sock_fd, (const struct sockaddr *)&unspec,
sizeof(unspec));
}
}
Problem is that udp_disconnect() could run without holding socket lock,
and this was causing list corruptions.
Signed-off-by: Eric Dumazet <edumazet@google.com >
Reported-by: Baozeng Ding <sploving1@gmail.com >
Signed-off-by: David S. Miller <davem@davemloft.net >
2016-10-20 14:45:52 -04:00
..
2016-09-19 20:19:34 +02:00
2015-09-21 16:03:04 -07:00
2016-10-05 20:25:48 -04:00
2016-09-25 23:34:19 +02:00
2016-07-11 02:01:14 +02:00
2016-02-11 03:54:14 -05:00
2016-10-02 22:20:41 -04:00
2016-09-23 07:22:11 -04:00
2016-06-15 20:41:22 -07:00
2016-08-17 19:27:51 -04:00
2016-09-30 01:54:28 -04:00
2015-09-17 13:20:05 +02:00
2016-09-08 11:10:12 +01:00
2016-09-04 13:29:29 -07:00
2016-08-02 02:57:29 +03:00
2016-02-09 04:45:49 -05:00
2016-09-27 21:15:21 -04:00
2015-11-18 16:17:38 -05:00
2016-06-27 15:06:17 -04:00
2016-10-12 09:19:10 +02:00
2016-07-08 12:20:57 +02:00
2016-03-13 15:01:00 -04:00
2016-04-19 20:09:25 -04:00
2016-04-25 16:44:27 -04:00
2016-06-25 12:19:35 -04:00
2016-04-25 16:44:27 -04:00
2016-06-09 23:41:03 -07:00
2016-08-26 11:55:18 -07:00
2015-09-17 17:18:37 -07:00
2016-09-23 08:38:50 -04:00
2016-02-16 20:21:48 -05:00
2016-09-10 20:53:55 -07:00
2015-10-08 04:27:02 -07:00
2016-04-25 16:20:09 -04:00
2015-09-23 15:33:15 -07:00
2016-06-08 11:36:02 -07:00
2016-09-01 16:51:08 -07:00
2016-09-10 23:12:53 -07:00
2016-05-20 18:03:16 -04:00
2016-09-30 13:29:21 +02:00
2016-09-30 13:29:21 +02:00
2016-06-07 16:37:14 -07:00
2016-02-18 11:42:19 -05:00
2016-06-17 20:23:32 -07:00
2016-08-18 01:17:32 -04:00
2016-07-22 00:50:41 -04:00
2016-07-25 17:55:43 -07:00
2016-03-14 12:19:46 -04:00
2016-04-27 22:48:25 -04:00
2016-09-12 11:45:45 +02:00
2016-01-04 20:40:41 +01:00
2016-10-14 10:59:15 -04:00
2015-12-15 23:25:20 -05:00
2016-03-22 15:45:44 -04:00
2016-04-04 22:11:20 -04:00
2016-05-20 18:03:17 -04:00
2016-09-21 00:23:01 -04:00
2016-08-13 15:08:00 -07:00
2016-02-16 20:42:54 -05:00
2016-04-04 22:11:20 -04:00
2016-06-27 15:05:28 -04:00
2015-10-20 06:08:27 -07:00
2015-12-16 00:14:12 -05:00
2016-03-13 23:55:13 -04:00
2015-11-15 17:12:37 -05:00
2016-09-19 01:25:22 -04:00
2016-09-17 10:13:07 -04:00
2016-09-28 04:48:00 -04:00
2016-09-17 10:13:07 -04:00
2016-06-06 09:47:25 +09:00
2016-10-17 10:17:05 -04:00
2016-07-07 10:15:34 +10:00
2016-01-29 17:13:43 +01:00
2016-08-17 19:36:23 -04:00
2016-10-13 12:05:26 -04:00
2016-08-30 22:27:18 -07:00
2016-09-30 14:46:57 +02:00
2016-07-08 13:23:12 +02:00
2015-10-23 06:26:42 -07:00
2016-10-03 02:00:22 -04:00
2016-10-04 02:11:51 -04:00
2016-06-15 20:41:23 -07:00
2016-08-08 14:42:04 -05:00
2016-07-05 09:06:29 -07:00
2016-06-27 15:06:18 -04:00
2016-05-16 13:46:23 -04:00
2015-12-08 22:02:33 -05:00
2016-07-08 12:20:57 +02:00
2016-03-23 22:09:58 -04:00
2016-09-28 05:02:44 -04:00
2016-08-10 17:19:02 -07:00
2016-08-15 10:55:53 -07:00
2016-04-07 16:53:30 -04:00
2016-02-11 03:54:14 -05:00
2016-04-04 22:11:19 -04:00
2016-09-10 23:12:53 -07:00
2016-06-30 06:15:04 -04:00
2016-09-19 01:47:18 -04:00
2016-02-08 10:30:42 -05:00
2016-04-28 11:49:45 -04:00
2016-01-19 14:44:23 -05:00
2016-09-23 06:46:57 -04:00
2016-08-28 23:32:41 -04:00
2016-09-28 04:48:00 -04:00
2016-10-17 10:17:05 -04:00
2016-05-03 16:08:14 -04:00
2015-10-26 22:24:22 -07:00
2016-06-17 20:23:32 -07:00
2016-10-20 14:45:52 -04:00
2016-09-10 20:53:55 -07:00
2016-09-23 06:46:57 -04:00