Re: [PATCH] namespace: Added pointer check in copy_mnt_ns()

From: Matthew Wilcox
Date: Wed Nov 16 2022 - 13:17:01 EST


On Wed, Nov 16, 2022 at 12:12:55PM +0300, Denis Arefev wrote:
> Return value of a function 'next_mnt' is dereferenced at
> namespace.c:3377 without checking for null,
> but it is usually checked for this function
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.

You need to do human analysis, not just send the results from a bot.
What conditions can lead to this function returning NULL? Do we
already know those conditions can or cannot hold?