lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240830214757.GA3819549@thelio-3990X>
Date: Fri, 30 Aug 2024 14:47:57 -0700
From: Nathan Chancellor <nathan@...nel.org>
To: Simon Horman <horms@...nel.org>
Cc: Naresh Kamboju <naresh.kamboju@...aro.org>,
	clang-built-linux <llvm@...ts.linux.dev>,
	Netdev <netdev@...r.kernel.org>,
	open list <linux-kernel@...r.kernel.org>,
	lkft-triage@...ts.linaro.org,
	Linux Regressions <regressions@...ts.linux.dev>,
	Anders Roxell <anders.roxell@...aro.org>,
	Dan Carpenter <dan.carpenter@...aro.org>,
	Arnd Bergmann <arnd@...db.de>,
	Nick Desaulniers <ndesaulniers@...gle.com>,
	Florian Westphal <fw@...len.de>,
	Steffen Klassert <steffen.klassert@...unet.com>
Subject: Re: net/xfrm/xfrm_policy.c:1286:8: error: variable 'dir' is
 uninitialized when used here [-Werror,-Wuninitialized]

Hi Simon (and Naresh),

On Fri, Aug 30, 2024 at 06:04:49PM +0100, Simon Horman wrote:
> On Fri, Aug 30, 2024 at 05:47:06PM +0100, Simon Horman wrote:
> > + Florian, Steffen
> > 
> > On Fri, Aug 30, 2024 at 12:15:10PM +0530, Naresh Kamboju wrote:
> > > The x86_64 defconfig builds failed on today's Linux next-20240829
> > > due to following build warnings / errors.
> > > 
> > > Regressions:
> > > * i386, build
> > >   - clang-18-defconfig
> > >   - clang-nightly-defconfig
> > > 
> > > * x86_64, build
> > >   - clang-18-lkftconfig
> > >   - clang-18-lkftconfig-compat
> > >   - clang-18-lkftconfig-kcsan
> > >   - clang-18-lkftconfig-no-kselftest-frag
> > >   - clang-18-x86_64_defconfig
> > >   - clang-nightly-lkftconfig
> > >   - clang-nightly-lkftconfig-kselftest
> > >   - clang-nightly-x86_64_defconfig
> > >   - rustclang-nightly-lkftconfig-kselftest
> > > 
> > > first seen on next-20240829.
> > >   Good: next-20240828
> > >   BAD:  next-20240829
> > > 
> > > Reported-by: Linux Kernel Functional Testing <lkft@...aro.org>
> > > 
> > > build log:
> > > --------
> > > net/xfrm/xfrm_policy.c:1286:8: error: variable 'dir' is uninitialized
> > > when used here [-Werror,-Wuninitialized]
> > >  1286 |                 if ((dir & XFRM_POLICY_MASK) == XFRM_POLICY_OUT) {
> > >       |                      ^~~
> > > net/xfrm/xfrm_policy.c:1257:9: note: initialize the variable 'dir' to
> > > silence this warning
> > >  1257 |         int dir;
> > >       |                ^
> > >       |                 = 0
> > > 1 error generated.

Thanks for the report.

> > I believe that is due to
> > commit 08c2182cf0b4 ("xfrm: policy: use recently added helper in more places")
> > 
> > I will work on a fix to initialise dir in the loop where it is used.
> 
> Patch is here:
> - [PATCH ipsec-next] xfrm: Initialise dir in xfrm_hash_rebuild()
>   https://lore.kernel.org/netdev/20240830-xfrm_hash_rebuild-dir-v1-1-f75092d07e1b@kernel.org/T/#u

I sent the same patch as a v1 but Florian pointed out that dir needs to
be initialized in the other loop too. I sent my v2 for it yesterday, it
just needs to be merged.

https://lore.kernel.org/all/20240829-xfrm-restore-dir-assign-xfrm_hash_rebuild-v2-1-1cf8958f6e8e@kernel.org/

Cheers,
Nathan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ