Eric Dumazet
d198b27762
Revert "Revert "ipv4: fix memory leaks in ip_cmsg_send() callers""
...
This reverts commit d7807a9adf4856171f8441f13078c33941df48ab.
As mentioned in https://lkml.org/lkml/2021/9/13/1819
5 years old commit 919483096bfe ("ipv4: fix memory leaks in ip_cmsg_send() callers")
was a correct fix.
ip_cmsg_send() can loop over multiple cmsghdr()
If IP_RETOPTS has been successful, but following cmsghdr generates an error,
we do not free ipc.ok
If IP_RETOPTS is not successful, we have freed the allocated temporary space,
not the one currently in ipc.opt.
Sure, code could be refactored, but let's not bring back old bugs.
Fixes: d7807a9adf48 ("Revert "ipv4: fix memory leaks in ip_cmsg_send() callers"")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Yajun Deng <yajun.deng@linux.dev>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-09-14 14:24:31 +01:00
..
2020-08-10 12:06:44 -07:00
2021-08-25 13:06:48 +02:00
2021-08-23 17:50:24 -07:00
2021-06-30 15:51:09 -07:00
2020-11-13 14:24:39 -08:00
2021-08-25 17:40:35 -07:00
2021-09-03 13:52:29 +01:00
2019-11-01 14:57:52 -07:00
2021-08-04 10:01:26 +01:00
2021-06-09 09:38:52 +02:00
2021-07-20 16:14:23 +02:00
2021-07-13 09:28:29 -07:00
2021-06-07 14:08:30 -07:00
2019-10-04 11:10:56 -07:00
2020-07-28 17:42:31 -07:00
2021-08-05 13:27:50 +01:00
2021-07-20 06:00:38 -07:00
2021-08-31 12:03:33 +01:00
2021-05-17 15:29:35 -07:00
2021-01-29 20:39:14 -08:00
2021-08-05 13:27:50 +01:00
2021-08-13 06:41:22 -07:00
2021-08-18 11:39:44 +01:00
2021-07-13 09:28:29 -07:00
2020-12-12 15:08:54 -08:00
2021-06-15 18:01:05 +02:00
2020-08-19 14:06:36 +02:00
2021-03-01 13:32:12 -08:00
2019-09-20 18:23:33 -07:00
2019-08-08 15:55:10 -07:00
2021-09-05 18:59:32 +01:00
2021-02-03 14:51:39 -08:00
2020-08-25 06:28:02 -07:00
2021-08-30 12:47:09 +01:00
2021-09-14 14:24:31 +01:00
2021-01-08 19:25:35 -08:00
2021-07-31 09:14:46 -07:00
2021-07-27 20:11:44 +01:00
2021-06-30 15:51:09 -07:00
2021-06-02 13:27:03 -07:00
2021-07-27 20:11:44 +01:00
2019-10-04 11:10:56 -07:00
2021-07-07 20:52:25 -07:00
2020-08-18 16:02:16 -07:00
2021-02-26 12:28:03 -08:00
2020-11-16 08:08:54 -08:00
2021-04-18 22:04:16 +02:00
2019-05-21 10:50:45 +02:00
2021-09-02 11:42:13 +01:00
2021-09-14 14:24:31 +01:00
2021-06-23 12:56:08 -07:00
2021-05-17 15:29:35 -07:00
2021-07-13 09:28:29 -07:00
2021-09-14 14:24:31 +01:00
2021-08-31 12:03:03 +01:00
2020-12-16 11:01:04 -08:00
2021-06-15 18:01:05 +02:00
2021-08-11 15:00:15 -07:00
2020-03-16 18:26:54 -07:00
2021-07-15 19:54:22 +02:00
2019-05-21 10:50:45 +02:00
2021-05-04 11:58:28 -07:00
2021-03-26 20:41:51 -07:00
2019-05-30 11:26:32 -07:00
2018-10-10 22:26:00 -07:00
2020-02-27 18:50:19 -08:00
2021-08-16 17:25:49 -07:00
2020-07-06 13:23:03 -07:00
2020-07-06 13:23:03 -07:00
2019-05-21 10:50:45 +02:00
2019-05-21 10:50:45 +02:00
2021-09-14 14:23:09 +01:00
2021-07-31 11:23:26 -07:00
2021-03-28 17:31:13 -07:00
2020-12-14 16:40:27 -08:00
2021-06-23 12:56:08 -07:00
2019-05-21 10:50:45 +02:00
2021-08-02 10:20:56 +01:00
2021-08-18 11:39:44 +01:00
2019-05-21 10:50:45 +02:00
2021-07-27 20:07:21 +01:00
2020-08-24 17:31:20 -07:00
2021-06-29 11:28:21 -07:00
2020-03-09 22:34:58 +01:00
2020-10-13 17:11:52 -07:00
2017-11-02 11:10:55 +01:00
2020-07-06 13:23:03 -07:00
2019-05-21 10:50:45 +02:00
2021-06-29 11:54:36 -07:00
2021-08-26 18:00:40 -07:00
2021-05-17 15:29:35 -07:00
2021-07-23 16:13:06 +01:00
2021-07-13 09:28:29 -07:00
2020-07-24 15:41:54 -07:00
2021-08-31 12:03:33 +01:00
2021-01-07 12:53:29 -08:00
2021-09-13 12:38:45 +01:00
2020-07-10 13:54:00 -07:00
2021-09-14 14:24:31 +01:00
2021-05-17 15:29:35 -07:00
2020-05-06 09:40:08 +02:00
2020-05-11 15:12:27 +02:00
2019-12-24 22:28:54 -08:00
2021-05-17 15:29:35 -07:00
2020-05-06 09:40:08 +02:00
2021-06-09 09:38:52 +02:00