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: Thu, 14 Mar 2024 15:39:28 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Steven Rostedt <rostedt@...dmis.org>, LKML
 <linux-kernel@...r.kernel.org>,  Linux Trace Kernel
 <linux-trace-kernel@...r.kernel.org>, netdev <netdev@...r.kernel.org>
Cc: Yisen Zhuang <yisen.zhuang@...wei.com>, Salil Mehta
 <salil.mehta@...wei.com>,  Jijie Shao <shaojijie@...wei.com>, "David S.
 Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub
 Kicinski <kuba@...nel.org>, Yufeng Mo <moyufeng@...wei.com>, Huazhong Tan
 <tanhuazhong@...wei.com>
Subject: Re: [PATCH] net: hns3: tracing: fix hclgevf trace event strings

On Wed, 2024-03-13 at 09:34 -0400, Steven Rostedt wrote:
> From: "Steven Rostedt (Google)" <rostedt@...dmis.org>
> 
> [
>    Note, I need to take this patch through my tree, so I'm looking for acks.

Note that this device driver is changing quite rapidly, so I expect
some conflicts here later. I guess Liuns will have to handle them ;)

>    This causes the build to fail when I add the __assign_str() check, which
>    I was about to push to Linus, but it breaks allmodconfig due to this error.
> ]
> 
> The __string() and __assign_str() helper macros of the TRACE_EVENT() macro
> are going through some optimizations where only the source string of
> __string() will be used and the __assign_str() source will be ignored and
> later removed.
> 
> To make sure that there's no issues, a new check is added between the
> __string() src argument and the __assign_str() src argument that does a
> strcmp() to make sure they are the same string.
> 
> The hclgevf trace events have:
> 
>   __assign_str(devname, &hdev->nic.kinfo.netdev->name);
> 
> Which triggers the warning:
> 
> hclgevf_trace.h:34:39: error: passing argument 1 of ‘strcmp’ from incompatible pointer type [-Werror=incompatible-pointer-types]
>    34 |                 __assign_str(devname, &hdev->nic.kinfo.netdev->name);
>  [..]
> arch/x86/include/asm/string_64.h:75:24: note: expected ‘const char *’ but argument is of type ‘char (*)[16]’
>    75 | int strcmp(const char *cs, const char *ct);
>       |            ~~~~~~~~~~~~^~
> 
> 
> Because __assign_str() now has:
> 
> 	WARN_ON_ONCE(__builtin_constant_p(src) ?		\
> 		     strcmp((src), __data_offsets.dst##_ptr_) :	\
> 		     (src) != __data_offsets.dst##_ptr_);	\
> 
> The problem is the '&' on hdev->nic.kinfo.netdev->name. That's because
> that name is:
> 
> 	char			name[IFNAMSIZ]
> 
> Where passing an address '&' of a char array is not compatible with strcmp().
> 
> The '&' is not necessary, remove it.
> 
> Fixes: d8355240cf8fb ("net: hns3: add trace event support for PF/VF mailbox")

checkpactch in strict mode complains the hash is not 12 char long.

> Signed-off-by: Steven Rostedt (Google) <rostedt@...dmis.org>

FWIW

Acked-by: Paolo Abeni <pabeni@...hat.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ