Skip to content
Commit 24980136 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

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: default avatar <syzbot+dc54d9ba8153b216cae0@syzkaller.appspotmail.com>
Fixes: 50a896cf

 ("genetlink: properly support per-op policy dumping")
Link: https://lore.kernel.org/r/20220816161939.577583-1-kuba@kernel.org
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 5c23d6b7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment