Jakub Kicinski 249801360d net: genl: fix error path memory leak in policy dumping
If construction of the array of policies fails when recording
non-first policy we need to unwind.

netlink_policy_dump_add_policy() itself also needs fixing as
it currently gives up on error without recording the allocated
pointer in the pstate pointer.

Reported-by: syzbot+dc54d9ba8153b216cae0@syzkaller.appspotmail.com
Fixes: 50a896cf2d6f ("genetlink: properly support per-op policy dumping")
Link: https://lore.kernel.org/r/20220816161939.577583-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-08-18 10:20:48 -07:00
..
2022-08-08 20:04:35 -07:00
2022-02-25 09:36:06 +01:00
2022-08-05 09:41:12 -07:00
2022-05-25 12:22:58 -07:00
2022-04-07 21:06:41 -07:00
2022-08-10 09:24:41 +01:00
2022-07-14 22:45:34 +02:00
2022-03-03 09:55:28 +00:00
2021-07-29 15:06:49 +01:00
2022-08-03 16:29:08 -07:00