[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aa5078d8-ac2f-1124-03f8-0d37d4c15005@quicinc.com>
Date: Fri, 18 Oct 2024 13:41:22 -0600
From: Jeffrey Hugo <quic_jhugo@...cinc.com>
To: Simon Horman <horms@...nel.org>, "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
"Paolo
Abeni" <pabeni@...hat.com>
CC: Woojung Huh <woojung.huh@...rochip.com>, Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>,
Richard Cochran <richardcochran@...il.com>,
Jiawen Wu
<jiawenwu@...stnetic.com>,
Mengyuan Lou <mengyuanlou@...-swift.com>,
"Nathan
Chancellor" <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>,
Bill Wendling <morbo@...gle.com>,
Justin Stitt <justinstitt@...gle.com>,
"Carl Vanderlip" <quic_carlv@...cinc.com>,
Oded Gabbay <ogabbay@...nel.org>, <UNGLinuxDriver@...rochip.com>,
<netdev@...r.kernel.org>, <llvm@...ts.linux.dev>,
<linux-arm-msm@...r.kernel.org>, <dri-devel@...ts.freedesktop.org>
Subject: Re: [PATCH net-next 3/3] accel/qaic: Pass string literal as format
argument of alloc_workqueue()
On 10/11/2024 3:57 AM, Simon Horman wrote:
> Recently I noticed that both gcc-14 and clang-18 report that passing
> a non-string literal as the format argument of alloc_workqueue()
> is potentially insecure.
>
> E.g. clang-18 says:
>
> .../qaic_drv.c:61:23: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
> 61 | wq = alloc_workqueue(fmt, WQ_UNBOUND, 0);
> | ^~~
> .../qaic_drv.c:61:23: note: treat the string as an argument to avoid this
> 61 | wq = alloc_workqueue(fmt, WQ_UNBOUND, 0);
> | ^
> | "%s",
>
> It is always the case where the contents of fmt is safe to pass as the
> format argument. That is, in my understanding, it never contains any
> format escape sequences.
>
> But, it seems better to be safe than sorry. And, as a bonus, compiler
> output becomes less verbose by addressing this issue as suggested by
> clang-18.
>
> Also, change the name of the parameter of qaicm_wq_init from
> fmt to name to better reflect it's purpose.
>
> Compile tested only.
>
> Signed-off-by: Simon Horman <horms@...nel.org>
Applied to drm-misc-next
Powered by blists - more mailing lists