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: <a80bf1c1-a878-43dc-9bce-0b1cf9c059a3@infradead.org>
Date: Thu, 22 Jan 2026 23:17:27 -0800
From: Randy Dunlap <rdunlap@...radead.org>
To: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>,
 Stephen Rothwell <sfr@...b.auug.org.au>, Thomas Gleixner
 <tglx@...utronix.de>, Ingo Molnar <mingo@...nel.org>,
 "H. Peter Anvin" <hpa@...or.com>, Marco Elver <elver@...gle.com>,
 Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
 Linux Next Mailing List <linux-next@...r.kernel.org>,
 Mauro Carvalho Chehab <mchehab@...nel.org>,
 Linux Documentation <linux-doc@...r.kernel.org>,
 Jonathan Corbet <corbet@....net>
Subject: Re: linux-next: [DOCS] build warning after merge of the tip tree

Hi Mauro,

On 1/22/26 11:11 PM, Mauro Carvalho Chehab wrote:
> On Thu, 22 Jan 2026 17:06:28 -0800
> Randy Dunlap <rdunlap@...radead.org> wrote:
> 
>> + linux-doc + Jon
>>
>> On 1/7/26 2:10 PM, Randy Dunlap wrote:
>>>
>>>
>>> On 1/7/26 1:54 PM, Peter Zijlstra wrote:  
>>>> On Wed, Jan 07, 2026 at 04:15:48PM +1100, Stephen Rothwell wrote:  
>>>>> Hi all,
>>>>>
>>>>> After merging the tip tree, today's linux-next build (htmldocs) produced
>>>>> this warning:
>>>>>
>>>>> Documentation/core-api/kref:328: include/linux/kref.h:72: WARNING: Invalid C declaration: Expected end of definition. [error at 96]
>>>>>   int kref_put_mutex (struct kref *kref, void (*release)(struct kref *kref), str
>>>>> uct mutex *mutex) __cond_acquires(true# mutex)
>>>>>   ------------------------------------------------------------------------------------------------^
>>>>> Documentation/core-api/kref:328: include/linux/kref.h:94: WARNING: Invalid C declaration: Expected end of definition. [error at 92]
>>>>>   int kref_put_lock (struct kref *kref, void (*release)(struct kref *kref), spinlock_t *lock) __cond_acquires(true# lock)
>>>>>   --------------------------------------------------------------------------------------------^
>>>>>
>>>>> Introduced by commit
>>>>>
>>>>>   5e256db9325e ("kref: Add context-analysis annotations")  
>>>>
>>>> I really have no clue what that thing is on about. The code is fine and
>>>> works as intended.
>>>>
>>>> My go-to fix for anything kdoc is to change '/**' into '/*' until it
>>>> goes away.  
>>>
>>> Yes, that works.
>>>
>>> I think that kernel-doc is just confused by the trailing __cond_acquires(true# lock).
>>>
>>> Mauro, would you take a look, please?  
>> We can trivially ignore "__cond_acquires(.*)" in kernel-doc to
>> eliminate such build warnings.
>>
>> Is that sufficient? Sure.
>> Is it the right thing to do? IDK.
>> Comments?
> 
> This fix sounds right to me. If not there at the patch,
> I would improve the include/linux/kref.h documentation to 
> describe __cond_requires() inside the kernel-doc documentation
> (or at kref.rst).

It's there in include/linux/compiler-context-analysis.h.

> 
>>
>> ~Randy
>> ---
>>  tools/lib/python/kdoc/kdoc_parser.py |    1 +
>>  1 file changed, 1 insertion(+)
>>
>> --- a/tools/lib/python/kdoc/kdoc_parser.py
>> +++ b/tools/lib/python/kdoc/kdoc_parser.py
>> @@ -186,6 +186,7 @@ function_xforms  = [
>>      (KernRe(r"__sched +"), ""),
>>      (KernRe(r"_noprof"), ""),
>>      (KernRe(r"__always_unused *"), ""),
>> +    (KernRe(r"__cond_acquires\s*\(.*\)"), ""),
> 
> Regex here is too broad, as it is greedy: it may drop more
> than expected. Perhaps:
> 
>     (KernRe(r"__cond_acquires\s*\([^\)]*\)"), ""),

Ah, thanks.

> With that, feel free to add:
> 
> 	Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
> 
>>      (KernRe(r"__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +"), ""),
>>      (KernRe(r"__(?:re)?alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +"), ""),
>>      (KernRe(r"__diagnose_as\s*\(\s*\S+\s*(?:,\s*\d+\s*)*\) +"), ""),
>>
> 
> 
> Thanks,
> Mauro

-- 
~Randy


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ