From: Pablo Neira Ayuso <pablo@netfilter•org>
To: kovalev@altlinux•org
Cc: netdev@vger•kernel.org, pabeni@redhat•com, davem@davemloft•net,
edumazet@google•com, kuba@kernel•org, jiri@resnulli•us,
jacob.e.keller@intel•com, johannes@sipsolutions•net,
idosch@nvidia•com, horms@kernel•org, david.lebrun@uclouvain•be
Subject: Re: [PATCH net ver.2] genetlink: fix possible use-after-free and null-ptr-deref in genl_dumpit()
Date: Tue, 20 Feb 2024 11:36:13 +0100 [thread overview]
Message-ID: <ZdSAndRQxKGkV/EO@calendula> (raw)
In-Reply-To: <20240220102512.104452-1-kovalev@altlinux.org>
On Tue, Feb 20, 2024 at 01:25:12PM +0300, kovalev@altlinux•org wrote:
> From: Vasiliy Kovalev <kovalev@altlinux•org>
>
> The pernet operations structure for the subsystem must be registered
> before registering the generic netlink family.
IIRC, you pointed to a syzbot report on genetlink similar to gtp.
Maybe add that tag here and get the robot to test this fix?
I'd suggest to describe the scenario, which is: There is a race that
allows netlink dump and walking on pernet data while such pernet data
is not yet set up.
Thanks.
> Introduced in commit 134e63756d5f ("genetlink: make netns aware")
> Signed-off-by: Vasiliy Kovalev <kovalev@altlinux•org>
> ---
> net/netlink/genetlink.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c
> index 8c7af02f845400..20a7d792dd52ec 100644
> --- a/net/netlink/genetlink.c
> +++ b/net/netlink/genetlink.c
> @@ -1879,14 +1879,14 @@ static int __init genl_init(void)
> {
> int err;
>
> - err = genl_register_family(&genl_ctrl);
> - if (err < 0)
> - goto problem;
> -
> err = register_pernet_subsys(&genl_pernet_ops);
> if (err)
> goto problem;
>
> + err = genl_register_family(&genl_ctrl);
> + if (err < 0)
> + goto problem;
> +
> return 0;
>
> problem:
> --
> 2.33.8
>
next prev parent reply other threads:[~2024-02-20 10:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-20 10:25 [PATCH net ver.2] genetlink: fix possible use-after-free and null-ptr-deref in genl_dumpit() kovalev
2024-02-20 10:36 ` Pablo Neira Ayuso [this message]
2024-02-20 11:03 ` kovalev
2024-02-22 1:23 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZdSAndRQxKGkV/EO@calendula \
--to=pablo@netfilter$(echo .)org \
--cc=davem@davemloft$(echo .)net \
--cc=david.lebrun@uclouvain$(echo .)be \
--cc=edumazet@google$(echo .)com \
--cc=horms@kernel$(echo .)org \
--cc=idosch@nvidia$(echo .)com \
--cc=jacob.e.keller@intel$(echo .)com \
--cc=jiri@resnulli$(echo .)us \
--cc=johannes@sipsolutions$(echo .)net \
--cc=kovalev@altlinux$(echo .)org \
--cc=kuba@kernel$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox