mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kirill Tkhai <ktkhai@virtuozzo.com>
To: Aditya Pakki <pakki001@umn.edu>
Cc: kjlu@umn.edu, "David S. Miller" <davem@davemloft.net>,
	Andrei Vagin <avagin@virtuozzo.com>,
	Tyler Hicks <tyhicks@canonical.com>,
	Matthew Wilcox <willy@infradead.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net/net_namespace: Check the return value of register_pernet_subsys()
Date: Mon, 24 Dec 2018 12:35:18 +0300	[thread overview]
Message-ID: <6498f7f5-b3cb-2d86-b0dc-ebd807948c3b@virtuozzo.com> (raw)
In-Reply-To: <20181224014239.11601-1-pakki001@umn.edu>

On 24.12.2018 04:42, Aditya Pakki wrote:
> In net_ns_init(), register_pernet_subsys() could fail while registering
> network namespace subsystems. The fix checks the return value and
> sends a panic() on failure.
> 
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>

Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com>

> ---
>  net/core/net_namespace.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
> index fefe72774aeb..af8849a7a9c3 100644
> --- a/net/core/net_namespace.c
> +++ b/net/core/net_namespace.c
> @@ -917,7 +917,8 @@ static int __init net_ns_init(void)
>  	init_net_initialized = true;
>  	up_write(&pernet_ops_rwsem);
>  
> -	register_pernet_subsys(&net_ns_ops);
> +	if (register_pernet_subsys(&net_ns_ops))
> +		panic("Could not register network namespace subsystems");
>  
>  	rtnl_register(PF_UNSPEC, RTM_NEWNSID, rtnl_net_newid, NULL,
>  		      RTNL_FLAG_DOIT_UNLOCKED);
> 

  reply	other threads:[~2018-12-24  9:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-24  1:42 Aditya Pakki
2018-12-24  9:35 ` Kirill Tkhai [this message]
2018-12-24 22:46 ` David Miller

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=6498f7f5-b3cb-2d86-b0dc-ebd807948c3b@virtuozzo.com \
    --to=ktkhai@virtuozzo.com \
    --cc=avagin@virtuozzo.com \
    --cc=davem@davemloft.net \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pakki001@umn.edu \
    --cc=tyhicks@canonical.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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

all inboxes | Powered by JetHome®