From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3A16AC43334 for ; Fri, 10 Jun 2022 06:45:20 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7933C1FA3; Fri, 10 Jun 2022 08:44:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7933C1FA3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1654843518; bh=2yFCZugsiNQZN0gkgMSO/PLnnK4cDobzksJyDLjp9Ts=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=mBZ0RYlZZA9KZLxkb+sJU1mVT/m8wENP6VMgL9IbmwvUS6ZvQV8MAgwBvCTpoWr1a S8qDet2xYvnDdTd/Q6mg72g+a5rT+zC+AMxtjXY+6COMPbTVcnrgCMR1ftRFdqm92M 5rJri61Up5o1UXE8oW7q7tZLuLCd89y9VI82i3ek= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 82C25F805DF; Fri, 10 Jun 2022 08:37:58 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 930FDF800C7; Fri, 10 Jun 2022 07:19:08 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F3A18F800C7 for ; Fri, 10 Jun 2022 07:19:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F3A18F800C7 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="rh1PySG6" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6BFB161E24; Fri, 10 Jun 2022 05:18:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C60CC34114; Fri, 10 Jun 2022 05:18:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654838336; bh=2yFCZugsiNQZN0gkgMSO/PLnnK4cDobzksJyDLjp9Ts=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rh1PySG6mRmieZPY8cY0A1hPrIcbkuP807V49e98ihkLxbZ06HxYRwIuVMf+wTLDn X/yCYKI3C60vy05a003Jfa/l8d0up/cE/3SCBy/NuCOYNPxYpirlNBYrpXNy/Wd9yS jlJr0CyMDaP1q3f/tt8/VcfJ3YUsM+y3ifSXc9V4= Date: Fri, 10 Jun 2022 07:18:49 +0200 From: Greg Kroah-Hartman To: Bill Wendling Subject: Re: [PATCH 07/12] driver/char: use correct format characters Message-ID: References: <20220609221702.347522-1-morbo@google.com> <20220609221702.347522-8-morbo@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220609221702.347522-8-morbo@google.com> X-Mailman-Approved-At: Fri, 10 Jun 2022 08:37:38 +0200 Cc: alsa-devel@alsa-project.org, x86@kernel.org, Nick Desaulniers , Dave Hansen , Phillip Potter , linux-mm@kvack.org, Eric Dumazet , "H. Peter Anvin" , isanbard@gmail.com, Daniel Kiper , "Rafael J. Wysocki" , Jozsef Kadlecsik , linux-acpi@vger.kernel.org, Ingo Molnar , Tom Rix , Jakub Kicinski , Paolo Abeni , Pablo Neira Ayuso , llvm@lists.linux.dev, coreteam@netfilter.org, Arnd Bergmann , Ross Philipson , Nathan Chancellor , Borislav Petkov , Thomas Gleixner , linux-edac@vger.kernel.org, Tony Luck , netdev@vger.kernel.org, Florian Westphal , Takashi Iwai , linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org, Jan Kara , Andrew Morton , "David S. Miller" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Thu, Jun 09, 2022 at 10:16:26PM +0000, Bill Wendling wrote: > From: Bill Wendling Why isn't that matching your From: line in the email? > > When compiling with -Wformat, clang emits the following warnings: Is that ever a default build option for the kernel? > > drivers/char/mem.c:775:16: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] > NULL, devlist[minor].name); > ^~~~~~~~~~~~~~~~~~~ > > Use a string literal for the format string. > > Link: https://github.com/ClangBuiltLinux/linux/issues/378 > Signed-off-by: Bill Wendling > --- > drivers/char/mem.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/char/mem.c b/drivers/char/mem.c > index 84ca98ed1dad..32d821ba9e4d 100644 > --- a/drivers/char/mem.c > +++ b/drivers/char/mem.c > @@ -772,7 +772,7 @@ static int __init chr_dev_init(void) > continue; > > device_create(mem_class, NULL, MKDEV(MEM_MAJOR, minor), > - NULL, devlist[minor].name); > + NULL, "%s", devlist[minor].name); Please explain how this static string can ever be user controlled. thanks, greg k-h