Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1079980iol; Thu, 9 Jun 2022 23:03:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRlgnpX4x9Htw+BYQDST1c3ySNESp4fbIHvjEfAEiqacdFgCum0UA8E6/kTHWlvXHrBjYn X-Received: by 2002:a05:6402:11c7:b0:42e:c47a:ffdf with SMTP id j7-20020a05640211c700b0042ec47affdfmr40696718edw.113.1654841021446; Thu, 09 Jun 2022 23:03:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654841021; cv=none; d=google.com; s=arc-20160816; b=vgYofoOIau2W43JItFW+cBxmyh2ZO7x98s4+/y16y9kR1dgT73m9+ncuTl3FsEsF/K uMAxN5qsTsQ5DcxfLGtZHveNwuXyG5YBmv9Nc4Xa5AXv+WGKvjKEpfZ8qNqgyPY033HS ZkUXlKYiEkrpVjFB5k9EmrMjkFCMrm8w3wDQKUuN31KQlNvG4J6TRQNd2M5dIZvd7+VO I31H5xDdLC9xyKP1e/EvUbERCT0SGYTWHMOmfnCjC6cL/OXRVitVPZ8LxTuIGTQlderY j+haK5RBGe/57Xz68H7wERZ9bQebdk8e6pwMExrdszmyR5W7LtscrQhC/Dd0yeY4a2an 6CoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hZjftfcs3gxRhG+SWH2x4eAEsg/jSHdldl+R3UD0hQ4=; b=DDel8BXPI1hlt/U4mfrMdl6R4AfHz3YOW587sv/JsyJzLOZATynQsyWuPKM1V8q3pi OrS4qqHB0wVyfWYXyWRlgc2XN9/SHkpB/1ylayObNqXX8H5rTWbZB0n8CdvhpmdARnFQ 849jAjTmg2TGM65zlVpwa28pO7uxBrrmZlGOEk60bkqnm+2wMtJhELNzUy4Q8G8ne7Y5 GyO5xoFg74pBa0uFCdXHr+ba02VDOZM/eworuPVhBolV3Kh07hOsCDul2c/1UzpXf3MV /wHCtHS5Zyur8wsScuAoliaFOhYfxsFCaOBA0yFG8TpSdEMNDg/kTOVxYyDPr1c8fihS fldg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rh1PySG6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g16-20020a056402181000b0042ddc352f85si28127938edy.107.2022.06.09.23.03.01; Thu, 09 Jun 2022 23:03:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rh1PySG6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244439AbiFJFTB (ORCPT + 99 others); Fri, 10 Jun 2022 01:19:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243933AbiFJFS6 (ORCPT ); Fri, 10 Jun 2022 01:18:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E58B935A8A; Thu, 9 Jun 2022 22:18:57 -0700 (PDT) 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 6F7F161E2B; 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 Cc: isanbard@gmail.com, Tony Luck , Borislav Petkov , Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Phillip Potter , Arnd Bergmann , "Rafael J. Wysocki" , Jan Kara , Andrew Morton , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jaroslav Kysela , Takashi Iwai , Nathan Chancellor , Nick Desaulniers , Tom Rix , Daniel Kiper , Ross Philipson , linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-mm@kvack.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, alsa-devel@alsa-project.org, llvm@lists.linux.dev 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-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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