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: <fafe90f3-5612-4dac-8ca7-4f0d0d6a05f7@linuxfoundation.org>
Date:   Thu, 12 Oct 2023 08:30:37 -0600
From:   Shuah Khan <skhan@...uxfoundation.org>
To:     Maciej Wieczór-Retman 
        <maciej.wieczor-retman@...el.com>, Shuah <shuah@...nel.org>
Cc:     ilpo.jarvinen@...ux.intel.com,
        Reinette Chatre <reinette.chatre@...el.com>,
        linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
        Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH v5 1/8] selftests: Add printf attribute to kselftest
 prints

On 10/12/23 01:32, Maciej Wieczór-Retman wrote:
> On 2023-10-11 at 13:40:48 -0600, Shuah wrote:
>> On 10/11/23 02:23, Maciej Wieczor-Retman wrote:
>>> Kselftest header defines multiple variadic functions that use printf
>>> along with other logic.
>>>
>>> There is no format checking for the variadic functions that use
>>> printing inside kselftest.h. Because of this the compiler won't
>>> be able to catch instances of mismatched printf formats and debugging
>>> tests might be more difficult.
>>>
>>> Add the common __printf attribute macro to kselftest.h.
>>>
>>> Add __printf attribute to every function using formatted printing with
>>> variadic arguments.
>>>
>>> Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@...el.com>
>>> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
>>> Reviewed-by: Reinette Chatre <reinette.chatre@...el.com>
>>> ---
>>> Changelog v4:
>>> - Fix typo in patch subject. (Reinette)
>>> - Add Reinette's reviewed-by tag.
>>>
>>
>> I still need information on how you found these problems. Please
>> add it to change log for each of these patches.
> 
> Sure, I'll add notes on methodology to patches 2-8. I understand that
> this patch (1/8) message doesn't need that addition since the problems
> it exposes are in separate patches.
>

Yes please. As mentioned a couple of times, I would like to see how
the problem is found in each patch commit log.

> Or would you like me to also note here more specifically what effect it
> has in the rest of the series?
> 

Yes please.

>> I am seeing checkpatch warning:
>>
>> WARNING: Prefer __printf(a, b) over __attribute__((format(printf, a, b)))
>> #102: FILE: tools/testing/selftests/kselftest.h:81:
>> +#define __printf(a, b)   __attribute__((format(printf, a, b)))
> 
> Running checkpatch.pl with --show-types shows the
> PREFER_DEFINED_ATTRIBUTE_MACRO is raised. From looking at the error
> message in the script it looks like a false positive:
> 	"Prefer $new over __attribute__(($orig_attr$params))\n"
> 
> Please correct me if my train of thought is wrong but I think checkpatch
> sees __printf() macro defined and it sees it's raw version
> "__attribute__((format(printf, a, b)))" which it wants to replace with
> the macro. But since the raw version is found in the define line that is
> obviously not possible.
> 

This is fine.

thanks,
-- Shuah

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ