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:
 <CH0PR18MB433921C8665B267684B5C3FECD9C2@CH0PR18MB4339.namprd18.prod.outlook.com>
Date: Wed, 4 Sep 2024 09:02:54 +0000
From: Geethasowjanya Akula <gakula@...vell.com>
To: Simon Horman <horms@...nel.org>,
        Sunil Kovvuri Goutham
	<sgoutham@...vell.com>,
        Linu Cherian <lcherian@...vell.com>, Jerin Jacob
	<jerinj@...vell.com>,
        Hariprasad Kelam <hkelam@...vell.com>,
        Subbaraya
 Sundeep Bhatta <sbhatta@...vell.com>
CC: "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet
	<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni
	<pabeni@...hat.com>,
        Nathan Chancellor <nathan@...nel.org>,
        Nick Desaulniers
	<ndesaulniers@...gle.com>,
        Bill Wendling <morbo@...gle.com>,
        Justin Stitt
	<justinstitt@...gle.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "llvm@...ts.linux.dev" <llvm@...ts.linux.dev>
Subject: RE: [EXTERNAL] [PATCH net-next 1/2] octeontx2-af: Pass string literal
 as format argument of alloc_workqueue()



>-----Original Message-----
>From: Simon Horman <horms@...nel.org>
>Sent: Tuesday, September 3, 2024 9:57 PM
>To: Sunil Kovvuri Goutham <sgoutham@...vell.com>; Linu Cherian
><lcherian@...vell.com>; Geethasowjanya Akula <gakula@...vell.com>;
>Jerin Jacob <jerinj@...vell.com>; Hariprasad Kelam <hkelam@...vell.com>;
>Subbaraya Sundeep Bhatta <sbhatta@...vell.com>
>Cc: David S. Miller <davem@...emloft.net>; Eric Dumazet
><edumazet@...gle.com>; Jakub Kicinski <kuba@...nel.org>; Paolo Abeni
><pabeni@...hat.com>; Nathan Chancellor <nathan@...nel.org>; Nick
>Desaulniers <ndesaulniers@...gle.com>; Bill Wendling
><morbo@...gle.com>; Justin Stitt <justinstitt@...gle.com>;
>netdev@...r.kernel.org; llvm@...ts.linux.dev
>Subject: [EXTERNAL] [PATCH net-next 1/2] octeontx2-af: Pass string literal as
>format argument of alloc_workqueue()
>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:
>
>.../rvu.c:2493:32: warning: format string is not a string literal (potentially
>insecure) [-Wformat-security]
> 2493 |         mw->mbox_wq = alloc_workqueue(name,
>      |                                       ^~~~
>.../rvu.c:2493:32: note: treat the string as an argument to avoid this
> 2493 |         mw->mbox_wq = alloc_workqueue(name,
>      |                                       ^
>      |                                       "%s",
>
>It is always the case where the contents of name 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.
>
>Compile tested only.
>
>Signed-off-by: Simon Horman <horms@...nel.org>
>---
> drivers/net/ethernet/marvell/octeontx2/af/rvu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
>b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
>index ac7ee3f3598c..1a97fb9032fa 100644
>--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
>+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
>@@ -2479,9 +2479,9 @@ static int rvu_mbox_init(struct rvu *rvu, struct
>mbox_wq_info *mw,
> 		goto free_regions;
> 	}
>
>-	mw->mbox_wq = alloc_workqueue(name,
>+	mw->mbox_wq = alloc_workqueue("%s",
> 				      WQ_UNBOUND | WQ_HIGHPRI |
>WQ_MEM_RECLAIM,
>-				      num);
>+				      num, name);
> 	if (!mw->mbox_wq) {
> 		err = -ENOMEM;
> 		goto unmap_regions;
>
>--
>2.45.2

Tested-by: Geetha sowjanya <gakula@...vell.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ