Mao Wenan
29b99f54a8
sctp: destroy bucket if failed to bind addr
There is one memory leak bug report:
BUG: memory leak
unreferenced object 0xffff8881dc4c5ec0 (size 40):
comm "syz-executor.0", pid 5673, jiffies 4298198457 (age 27.578s)
hex dump (first 32 bytes):
02 00 00 00 81 88 ff ff 00 00 00 00 00 00 00 00 ................
f8 63 3d c1 81 88 ff ff 00 00 00 00 00 00 00 00 .c=.............
backtrace:
[<0000000072006339>] sctp_get_port_local+0x2a1/0xa00 [sctp]
[<00000000c7b379ec>] sctp_do_bind+0x176/0x2c0 [sctp]
[<000000005be274a2>] sctp_bind+0x5a/0x80 [sctp]
[<00000000b66b4044>] inet6_bind+0x59/0xd0 [ipv6]
[<00000000c68c7f42>] __sys_bind+0x120/0x1f0 net/socket.c:1647
[<000000004513635b>] __do_sys_bind net/socket.c:1658 [inline]
[<000000004513635b>] __se_sys_bind net/socket.c:1656 [inline]
[<000000004513635b>] __x64_sys_bind+0x3e/0x50 net/socket.c:1656
[<0000000061f2501e>] do_syscall_64+0x72/0x2e0 arch/x86/entry/common.c:296
[<0000000003d1e05e>] entry_SYSCALL_64_after_hwframe+0x49/0xbe
This is because in sctp_do_bind, if sctp_get_port_local is to
create hash bucket successfully, and sctp_add_bind_addr failed
to bind address, e.g return -ENOMEM, so memory leak found, it
needs to destroy allocated bucket.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Mao Wenan <maowenan@huawei.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-09-13 22:06:20 +02:00
..
2019-07-06 12:50:01 +02:00
2019-07-12 17:31:19 -07:00
2019-06-19 17:09:55 +02:00
2019-06-22 08:59:24 -04:00
2019-06-05 17:37:10 +02:00
2019-05-30 11:26:32 -07:00
2019-06-16 14:22:37 -07:00
2019-08-23 18:20:31 +02:00
2019-09-05 09:02:59 +03:00
2019-05-30 11:29:53 -07:00
2019-07-12 16:03:16 -07:00
2019-09-10 09:10:53 +01:00
2019-05-30 11:29:22 -07:00
2019-07-24 11:19:03 +02:00
2019-08-28 12:33:46 +02:00
2019-09-12 11:55:34 +01:00
2019-05-30 11:29:52 -07:00
2019-07-18 17:08:07 -07:00
2019-05-24 17:36:42 +02:00
2019-07-10 18:43:43 -07:00
2019-08-27 20:31:12 -07:00
2019-06-07 11:00:14 -07:00
2019-07-11 14:37:45 -07:00
2019-08-24 13:46:57 -07:00
2019-05-21 10:50:46 +02:00
2019-09-11 23:53:18 +01:00
2019-09-12 11:20:33 +01:00
2019-07-29 10:26:14 -07:00
2019-06-19 17:09:55 +02:00
2019-07-08 19:48:57 -07:00
2019-07-30 14:42:13 -07:00
2019-06-23 13:24:17 -07:00
2019-06-17 20:20:36 -07:00
2019-06-05 17:36:36 +02:00
2019-09-11 14:59:26 +01:00
2019-05-30 11:26:41 -07:00
2019-08-25 14:34:08 -07:00
2019-08-22 19:27:02 -07:00
2019-09-03 22:55:42 +02:00
2019-05-21 11:28:45 +02:00
2019-06-14 19:50:33 -07:00
2019-07-24 15:49:05 -07:00
2019-07-08 12:46:24 -07:00
2019-06-19 17:09:55 +02:00
2019-08-28 14:53:51 -07:00
2019-08-15 13:59:48 -07:00
2019-06-05 17:37:07 +02:00
2019-08-28 15:53:51 -07:00
2019-09-12 11:58:44 +01:00
2019-09-11 15:05:40 +01:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:32 -07:00
2019-09-05 00:24:58 +02:00
2019-09-10 18:31:00 +01:00
2019-09-13 22:06:20 +02:00
2019-08-20 12:25:14 -07:00
2019-06-22 08:59:24 -04:00
2019-08-26 15:31:29 -04:00
2019-05-30 11:26:32 -07:00
2019-09-05 09:58:49 +02:00
2019-08-15 12:40:15 -07:00
2019-06-07 11:00:14 -07:00
2019-08-02 17:26:27 -07:00
2019-06-05 17:30:29 +02:00
2019-08-21 10:43:03 +02:00
2019-05-24 17:27:12 +02:00
2019-08-20 16:39:48 +02:00
2019-09-06 15:09:16 +02:00
2019-05-31 15:30:03 -06:00
2019-06-17 13:56:26 -07:00
2019-02-28 08:24:23 -07:00
2019-07-19 10:42:02 -07:00
2019-05-21 10:50:45 +02:00