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] [day] [month] [year] [list]
Message-ID: <90038621-0c42-404e-b9e5-0c2b8ea53b5a@embeddedor.com>
Date: Tue, 22 Apr 2025 14:48:11 -0600
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: Kees Cook <kees@...nel.org>, "Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc: linux-hardening@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2][next] kunit/overflow: Add tests for
 STACK_FLEX_ARRAY_SIZE() helper



On 22/04/25 14:39, Kees Cook wrote:
> On Tue, Apr 22, 2025 at 11:22:08AM -0600, Gustavo A. R. Silva wrote:
>> Add a couple of tests for new STACK_FLEX_ARRAY_SIZE() helper.
>>
>> Signed-off-by: Gustavo A. R. Silva <gustavoars@...nel.org>
>> ---
>>   lib/tests/overflow_kunit.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/lib/tests/overflow_kunit.c b/lib/tests/overflow_kunit.c
>> index 894691b4411a..3beb497a44be 100644
>> --- a/lib/tests/overflow_kunit.c
>> +++ b/lib/tests/overflow_kunit.c
>> @@ -1210,6 +1210,9 @@ static void DEFINE_FLEX_test(struct kunit *test)
>>   	KUNIT_EXPECT_EQ(test, __struct_size(empty->array), 0);
>>   	KUNIT_EXPECT_EQ(test, __member_size(empty->array), 0);
>>   
>> +	KUNIT_EXPECT_EQ(test, STACK_FLEX_ARRAY_SIZE(two, array), 2);
>> +	KUNIT_EXPECT_EQ(test, STACK_FLEX_ARRAY_SIZE(eight, array), 8);
> 
> Nice! Can you add a 0 test for "empty" as well?

Sure thing. I had actually added it, but for some reason I removed at the last
minute.

-Gustavo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ