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: <20250216093940.GA2192@1wt.eu>
Date: Sun, 16 Feb 2025 10:39:40 +0100
From: Willy Tarreau <w@....eu>
To: Thomas Weißschuh <linux@...ssschuh.net>
Cc: Shuah Khan <shuah@...nel.org>, linux-kselftest@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] selftests/nolibc: only run constructor tests on nolibc

On Wed, Feb 12, 2025 at 07:01:01PM +0100, Thomas Weißschuh wrote:
> The nolibc testsuite can be run against other libcs to test for
> interoperability. Some aspects of the constructor execution are not
> standardized and musl does not provide all tested feature, for one it
> does not provide arguments to the constructors, anymore?
>
> Skip the constructor tests on non-nolibc configurations.

I'm not much surprised, I've always avoided arguments in my use of
constructors due to a lack of portability. However the patch disables
all constructors tests, while I'm seeing that the linkage_test version
does not make use of arguments, though there is an implied expectation
that they're executed in declaration order, which is not granted.

I'm wondering if we shouldn't make the tests more robust:
  1) explicitly set linkage_test_constructor_test_value to zero in the
     declaration, because here it's not set so we have no guarantee
     (we're not in the kernel)
  2) only add values to check for cumulated values (e.g. |1 in const1,
     |2 in const2) and verify that the result is properly 3
  3) make the argument test add a distinct value (|4) so that when
     testing it's instantly obvious which test was not called.

And indeed, we can disable the tests we know fail on other libcs and
even split that by feature (e.g. test that at least one constructor
was called using !=0, that all non-arg ones were called via &3 == 3,
and that the args were passed via &4==4). That would allow to further
refine the tests if desired so that we can keep the differences in mind.

In any case all of this can also be done later, and I'm obviously fine
with this immediate adjustement.

> Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>

Acked-by: Willy Tarreau <w@....eu>

Willy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ