Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp888174iol; Thu, 9 Jun 2022 16:46:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwE66nz/Iz7bHNKyIVW4kTrW7nom7HSjXae6GtmX7O807G1AI/17EIN4vYF8laIMXDiXRlH X-Received: by 2002:a17:907:92c:b0:710:786a:470f with SMTP id au12-20020a170907092c00b00710786a470fmr29430528ejc.736.1654818385642; Thu, 09 Jun 2022 16:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654818385; cv=none; d=google.com; s=arc-20160816; b=OVd0+lF0siOedj4Q08wbXVtKoX7ckLlT45Vvw9wkVgzH9vaU4qxTVtXm5PxrdzZMqD IYV6pA80Sd+5en/aq/y1o63DDCuwcxf3A9DmX/TXUiqjzbqXWv2g/GNcEilqODc1WeaX /zzV9KdQmfollWdBQh9J3UOumIjujsdg1PmKbmcHbT+bzAfqXA2rCxMrOA+3Z9q1ko9x z5ognmNNt2AWRQIJ9nGtW/qVzTmEOUnqb1hY5Zb6HvmuhxDsDMJFGeRoT0pJKMh9otJF XnjVKQQwxClQNF2NpjZC0HlA36zIX9pbpaqsY4poW3/9ny3HpCf9YzfGRtIZRKdSUjWX Q0fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=OAj7kkMIiekJ9rTKt4JAtAfIGa2quITOg+UqYlGq1Vc=; b=XkK7zitLZvcdDL6fjihYwvG3+UrbtCmfjqaAvI/odcCTbYF460Rvg7KLiW0UfNNL+z EjsN6YD6RKVU0jmWe9g+ILBXJ1ewOYa3A6qnJvOtdmcuwfnRMqyvtNoGwi8TqJvnxppB vpPjZozgXd0RqbddZPB+Vhhn+1LH1CHSyyTJQqZ8kX6b+cfn1i1sgTG2J/XMTvsGAy9z 80twqmqmOq313F5vREe68iilyIdxF1GUhnOSrLEPtiAfAVgZj6qB3lNFyQQXGSdP6JgA 9NSvImJlcuWESN8rSFNASHb0NQkR7BVePYxF4zdOtQl3WS3E9w8SiDRfHEBJ0MGa9+NO IjhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="h+XSjN/W"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hs32-20020a1709073ea000b00711d61d0e1csi11841688ejc.109.2022.06.09.16.46.00; Thu, 09 Jun 2022 16:46:25 -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=@google.com header.s=20210112 header.b="h+XSjN/W"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345013AbiFIWti (ORCPT + 99 others); Thu, 9 Jun 2022 18:49:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345809AbiFIWtg (ORCPT ); Thu, 9 Jun 2022 18:49:36 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1337B5400B for ; Thu, 9 Jun 2022 15:49:35 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id be31so40218337lfb.10 for ; Thu, 09 Jun 2022 15:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OAj7kkMIiekJ9rTKt4JAtAfIGa2quITOg+UqYlGq1Vc=; b=h+XSjN/WVesJqDJFOPBbUOjCsElze90l5AUaZpaMfQE4BCHJP6262qTzyHWJva9Bl7 Ylea2b1VMRtuu3W6K04USb5N4DyE9/FJG1TJX23DJAAyMpmTkNe0IhcujfXyw2tL6Yzm 5AoAwHI63jQHxPEb7KgmYY7AsIWc/AhRsgnJ71aDa/ZsS0NcL3wur4vFJaN8UMyAklRE aEGCgipKXq1q5OQuT+b1/Z3ZAjDVwg+cOz821DhKZdc3CbTWkxewf2eBhHZ6cA8kCpl2 vQoxv4lOBXpPPrGtb7sLkscBoEWxzlYML194UCnlDBfFSziOT58BYv12MhyX6zYq7k9Z Vkrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OAj7kkMIiekJ9rTKt4JAtAfIGa2quITOg+UqYlGq1Vc=; b=3Bvl5JlagV9/RO0tVhfEA2UgBKiUXI/y6H7LMiMtffqKRK0KAbJ4gI9QL7JEtanbGv Btv9w9hjGzGGpUUCSNrYKkk/bknpBzrD/Fh/rIA41kX7BqsQJo/cJQj3GLPzwt3tVS/D s0GpX6E8bYBFpMpOTsiahTWCzXumzEK2+41f3HwhBig6s+G6UN7C8UXmNDvp4FYu4mzm iX/V93kzRFa6OMcjJUXNsbGfWZaNpTqRmIg112G0fXVtABdnnwLrvacUY4QL00Fns6/5 Vhs+pgJ3+bm0q6UkBfcSFBj5Db1vfntEQFE9lDAu4YAEnI1AbeYapDlPNAKarA4tQW9D yM/Q== X-Gm-Message-State: AOAM53293rw/mrL+Cy4VyALMm9oOpcmIqub+4BjB6Y90FncKaKu26Bsb M07g4jpnBls+v9i0A+64SzUy68lEA55GRi458WMT X-Received: by 2002:a05:6512:114e:b0:479:1e02:9318 with SMTP id m14-20020a056512114e00b004791e029318mr20896704lfg.156.1654814973186; Thu, 09 Jun 2022 15:49:33 -0700 (PDT) MIME-Version: 1.0 References: <20220609221702.347522-1-morbo@google.com> <20220609152527.4ad7862d4126e276e6f76315@linux-foundation.org> In-Reply-To: <20220609152527.4ad7862d4126e276e6f76315@linux-foundation.org> From: Bill Wendling Date: Thu, 9 Jun 2022 15:49:21 -0700 Message-ID: Subject: Re: [PATCH 00/12] Clang -Wformat warning fixes To: Andrew Morton Cc: Bill Wendling , Tony Luck , Borislav Petkov , Thomas Gleixner , Ingo Molnar , Dave Hansen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , Phillip Potter , Arnd Bergmann , Greg Kroah-Hartman , "Rafael J. Wysocki" , Jan Kara , 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 , Ross Philipson , Daniel Kiper , linux-edac@vger.kernel.org, LKML , ACPI Devel Maling List , linux-mm@kvack.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, Networking , alsa-devel@alsa-project.org, clang-built-linux Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 9, 2022 at 3:25 PM Andrew Morton wrote: > > On Thu, 9 Jun 2022 22:16:19 +0000 Bill Wendling wrote: > > > This patch set fixes some clang warnings when -Wformat is enabled. > > > > tldr: > > - printk(msg); > + printk("%s", msg); > > the only reason to make this change is where `msg' could contain a `%'. > Generally, it came from userspace. It helps kernel developers not accidentally to insert an unescaped '%' in their messages, potentially exposing their code to an attack vector. > Otherwise these changes are a > useless consumer of runtime resources. Calling a "printf" style function is already insanely expensive. :-) I understand that it's not okay blithely to increase runtime resources simply because it's already slow, but in this case it's worthwhile. > I think it would be better to quieten clang in some fashion. The "printk" and similar functions all have the "__printf" attribute. I don't know of a modification to that attribute which can turn off this type of check. -bw