Re: [PATCH v4 43/45] namei: initialize parameters passed to step_into()

From: Alexander Potapenko
Date: Mon Aug 08 2022 - 12:38:49 EST


On Fri, Jul 1, 2022 at 4:25 PM Alexander Potapenko <glider@xxxxxxxxxx> wrote:
>
> Under certain circumstances initialization of `unsigned seq` and
> `struct inode *inode` passed into step_into() may be skipped.
> In particular, if the call to lookup_fast() in walk_component()
> returns NULL, and lookup_slow() returns a valid dentry, then the
> `seq` and `inode` will remain uninitialized until the call to
> step_into() (see [1] for more info).
>
> Right now step_into() does not use these uninitialized values,
> yet passing uninitialized values to functions is considered undefined
> behavior (see [2]). To fix that, we initialize `seq` and `inode` at
> definition.

Given that Al Viro has a patch series in flight to address the
problem, I am going to drop this patch from KMSAN v5 series.