[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAL1p7m5XO7vdzr85WUiSPsN9OGopj7zPEAVj8VNJ0RGNSRvzDg@mail.gmail.com>
Date: Thu, 8 May 2025 14:55:52 -0400
From: Joel Savitz <jsavitz@...hat.com>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: linux-kernel@...r.kernel.org, Christian Brauner <brauner@...nel.org>
Subject: Re: [PATCH] kernel/nsproxy: guard all put_*_ns() calls
On Wed, May 7, 2025 at 5:41 PM Al Viro <viro@...iv.linux.org.uk> wrote:
>
> On Wed, May 07, 2025 at 12:13:28PM -0400, Joel Savitz wrote:
> > In free_nsproxy() and the error path of create_new_namespaces() all
> > calls to put_*_ns() are guarded by a null pointer check except for
> > put_cgroup_ns() and put_net(). When CONFIG_NET_NS or CONFIG_GROUP is
> > unset, either of these functions may be called with a NULL argument.
> > This may or may not be handled correctly, but at the very least it is
> > certainly quicker to just perform the null check in all cases.
>
> Why not simply make put_net(NULL) et.al. no-op instead?
>
It looks like that's the case whenever a namespace is disabled, i.e.
when NULL might be passed as an argument. I posted a v2 that now
removes the include guards.
Powered by blists - more mailing lists