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: <aEfTYkVdphiOhqPg@nvidia.com>
Date: Mon, 9 Jun 2025 23:40:34 -0700
From: Nicolin Chen <nicolinc@...dia.com>
To: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
CC: Shuah Khan <shuah@...nel.org>, Shuah Khan <skhan@...uxfoundation.org>,
	Willy Tarreau <w@....eu>, Thomas Weißschuh
	<linux@...ssschuh.net>, Kees Cook <kees@...nel.org>, Andy Lutomirski
	<luto@...capital.net>, Will Drewry <wad@...omium.org>, Mark Brown
	<broonie@...nel.org>, Muhammad Usama Anjum <usama.anjum@...labora.com>,
	<linux-kernel@...r.kernel.org>, <linux-kselftest@...r.kernel.org>, "Jason
 Gunthorpe" <jgg@...dia.com>
Subject: Re: [PATCH v4 12/14] selftests: harness: Stop using
 setjmp()/longjmp()

Hi Thomas,

CC += Jason

On Mon, May 05, 2025 at 05:15:30PM +0200, Thomas Weißschuh wrote:
> Usage of longjmp() was added to ensure that teardown is always run in
> commit 63e6b2a42342 ("selftests/harness: Run TEARDOWN for ASSERT failures")
> However instead of calling longjmp() to the teardown handler it is easier to
> just call the teardown handler directly from __bail().
> Any potential duplicate teardown invocations are harmless as the actual
> handler will only ever be executed once since
> commit fff37bd32c76 ("selftests/harness: Fix fixture teardown").
> 
> Additionally this removes a incompatibility with nolibc,
> which does not support setjmp()/longjmp().
> 
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh@...utronix.de>

The iommufd selftest (CONFIG_IOMMUFD_TEST) starts to give warnings
when building with v6.16-rc1, though the test code wasn't changed
at these two functions:
------------------------------------------------------------------
make: Entering directory '/nicolinc/linux-stable/tools/testing/selftests/iommu'
  CC       iommufd
iommufd.c: In function ‘wrapper_iommufd_mock_domain_all_aligns’:
iommufd.c:1806:17: warning: ‘mfd’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 1806 |                 close(mfd);
      |                 ^~~~~~~~~~
iommufd.c:1766:13: note: ‘mfd’ was declared here
 1766 |         int mfd;
      |             ^~~
iommufd.c: In function ‘wrapper_iommufd_mock_domain_all_aligns_copy’:
iommufd.c:1869:17: warning: ‘mfd’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 1869 |                 close(mfd);
      |                 ^~~~~~~~~~
iommufd.c:1818:13: note: ‘mfd’ was declared here
 1818 |         int mfd;
      |             ^~~
  CC       iommufd_fail_nth
make: Leaving directory '/nicolinc/linux-stable/tools/testing/selftests/iommu'
------------------------------------------------------------------

Git bisect points to this patch, and reverting it fixes these.

Both mfds are under the same "if (variant->driver)" check, so the
warnings don't seem legit to me.

Do you have any idea why this happens?

Thanks
Nicolin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ