[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250407175619.GA1730095@nvidia.com>
Date: Mon, 7 Apr 2025 14:56:19 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Leon Romanovsky <leon@...nel.org>, Yishai Hadas <yishaih@...dia.com>,
Zhu Yanjun <yanjun.zhu@...ux.dev>,
Chiara Meiohas <cmeiohas@...dia.com>, Arnd Bergmann <arnd@...db.de>,
linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] inifiniband: ucaps: avoid format-security warning
On Fri, Mar 14, 2025 at 04:57:15PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
>
> Passing a non-constant format string to dev_set_name causes a warning:
>
> drivers/infiniband/core/ucaps.c:173:33: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
> 173 | ret = dev_set_name(&ucap->dev, ucap_names[type]);
> | ^~~~~~~~~~~~~~~~
> drivers/infiniband/core/ucaps.c:173:33: note: treat the string as an argument to avoid this
> 173 | ret = dev_set_name(&ucap->dev, ucap_names[type]);
> | ^
> | "%s",
>
> Turn the name into thet %s argument as suggested by gcc.
>
> Fixes: 61e51682816d ("RDMA/uverbs: Introduce UCAP (User CAPabilities) API")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> Reviewed-by: Zhu Yanjun <yanjun.zhu@...ux.dev>
> Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
> ---
> drivers/infiniband/core/ucaps.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to for-rc, thanks
Jason
Powered by blists - more mailing lists