Re: [PATCH 176/190] Revert "net/net_namespace: Check the return value of register_pernet_subsys()"

From: Kirill Tkhai
Date: Wed Apr 21 2021 - 16:45:58 EST


On 21.04.2021 16:00, Greg Kroah-Hartman wrote:
> This reverts commit 0eb987c874dc93f9c9d85a6465dbde20fdd3884c.
>
> Commits from @umn.edu addresses have been found to be submitted in "bad
> faith" to try to test the kernel community's ability to review "known
> malicious" changes. The result of these submissions can be found in a
> paper published at the 42nd IEEE Symposium on Security and Privacy
> entitled, "Open Source Insecurity: Stealthily Introducing
> Vulnerabilities via Hypocrite Commits" written by Qiushi Wu (University
> of Minnesota) and Kangjie Lu (University of Minnesota).
>
> Because of this, all submissions from this group must be reverted from
> the kernel tree and will need to be re-reviewed again to determine if
> they actually are a valid fix. Until that work is complete, remove this
> change to ensure that no problems are being introduced into the
> codebase.
>
> Cc: Aditya Pakki <pakki001@xxxxxxx>
> Cc: Kirill Tkhai <ktkhai@xxxxxxxxxxxxx>
> Cc: David S. Miller <davem@xxxxxxxxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> ---
> net/core/net_namespace.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
> index 43b6ac4c4439..9ae0b275238e 100644
> --- a/net/core/net_namespace.c
> +++ b/net/core/net_namespace.c
> @@ -1101,8 +1101,7 @@ static int __init net_ns_init(void)
> init_net_initialized = true;
> up_write(&pernet_ops_rwsem);
>
> - if (register_pernet_subsys(&net_ns_ops))
> - panic("Could not register network namespace subsystems");
> + register_pernet_subsys(&net_ns_ops);

Nacked-by: Kirill Tkhai <ktkhai@xxxxxxxxxxxxx>

This patch does not have any problem, since it has been already carefully reviewed.
Kernel panics here only, if we can't allocate ns_common::inum for init_net.
This can be only a result of a critical deficiency of memory during boot.