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]
Date:   Tue, 6 Sep 2022 15:42:39 -0700
From:   Bart Van Assche <bvanassche@....org>
To:     Rasmus Villemoes <linux@...musvillemoes.dk>,
        Kees Cook <keescook@...omium.org>
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] testing/selftests: Add tests for the is_signed_type()
 macro

On 8/30/22 02:41, Rasmus Villemoes wrote:
> On 26/08/2022 18.21, Bart Van Assche wrote:
>> Although not documented, is_signed_type() must support the 'bool' and
>> pointer types next to scalar and enumeration types. Add a selftest that
>> verifies that this macro handles all supported types correctly.
>>
> 
>> +static void is_signed_type_test(struct kunit *test)
>> +{
>> +	KUNIT_EXPECT_EQ(test, is_signed_type(bool), false);
>> +	KUNIT_EXPECT_EQ(test, is_signed_type(signed char), true);
>> +	KUNIT_EXPECT_EQ(test, is_signed_type(unsigned char), false);
> 
> Nice. You could consider adding
> 
> #ifdef __UNSIGNED_CHAR__
> KUNIT_EXPECT_EQ(test, is_signed_type(char), false);
> #else
> KUNIT_EXPECT_EQ(test, is_signed_type(char), true);
> #endif
> 
> The kernel depends on the compiler providing __UNSIGNED_CHAR__ in two
> places (one in ext4, one in printf test suite).

(reduced Cc-list)

Hi Rasmus,

Since I would like to implement the above suggestion I tried to look up 
other uses of the __UNSIGNED_CHAR__ macro. However, I couldn't find any. 
Did I perhaps do something wrong?
  $ git grep -w __UNSIGNED_CHAR__ origin/master | wc
       0       0       0

Thanks,

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ