From patchwork Thu Jun 9 22:16:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Wendling X-Patchwork-Id: 580379 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9FCDCCA473 for ; Thu, 9 Jun 2022 22:20:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345712AbiFIWUs (ORCPT ); Thu, 9 Jun 2022 18:20:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345787AbiFIWUV (ORCPT ); Thu, 9 Jun 2022 18:20:21 -0400 Received: from mail-pj1-x104a.google.com (mail-pj1-x104a.google.com [IPv6:2607:f8b0:4864:20::104a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B30464CD5F for ; Thu, 9 Jun 2022 15:20:18 -0700 (PDT) Received: by mail-pj1-x104a.google.com with SMTP id j8-20020a17090a3e0800b001e3425c05c4so286405pjc.0 for ; Thu, 09 Jun 2022 15:20:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=dB/VRnBqrla/uo3hQxagOMwn8rw3rKKNrg8KvvIMmrs=; b=NA8rGIzS2Lo/FSyJFJSopJzo3vj2qG+W/JBu2Td+wh8lNm3aGHNFbCPALJTDiKY3VZ BXYoT+Ww8rgiNjDcWDo8JWEIvIa789ch4uJ/akkx61GHrCbS4UYTLU+WBzXi0U6zqFg6 WETSd0zF9UD0yrUhECgMgO4+3B7vaNDE5q4OxsAILit4vZz26MEF5lP7eGpObNUfQYZP qWyriCnElNMS5dBnlp4ECfJw4cwUWsda0JPVGIsCkMRh996FjTM9tl6X5Bjcl49Ex3bX 056kN/4A+KMGFsvjat6Zhxnibo6NVJe0KQfbbqHffKzcdpAaOGAQ/5H1gcLRSIgsdnQd eZOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=dB/VRnBqrla/uo3hQxagOMwn8rw3rKKNrg8KvvIMmrs=; b=4hjMqT57HmttjMIvbbVdn3ZcCZ+N+BeUPsrMhtnEHOGPC/Xvv4MInzC7YMZyP2SFZK cu90elwc/G63gQB9Kc3yBsxIJcdz4rkdWfCXR7s3RLZAeq/JYBtos0k1qYQWb70IfNhP 6oiZBbUW9keT/ok5i1epYGlrSkhNQ/UYB2G9XZkRANsTBOo92Dh1I1wglLaPBfMY5+Ym AUaHWINxvjrFmt+Pm6BB6j7vixQa+iwUIf6Jb9KIkEqeXBuCkO7Ug+MRXkY2/sX+qdFj VjZ9Xnxcd5B66+A0j+MbKDnPemAf+ulQOTsSMWiVLNuGCV+Kz7C6sV7dVChjw43of6EE UD3A== X-Gm-Message-State: AOAM531IRWX2Ipg/hM1QnB3UlxiKNVEzu7tEQi83vtoxuVJ6M7zIi8C0 8sielP1MIIxwwaKNLCtP8pGKtWCX X-Google-Smtp-Source: ABdhPJye2mFQrzIepKAqLUDnC7IYTgWuIi+7I2qa8DRzQUgLX+2gR0oj+bp3uxnl8nOmUO9s5APs/msqoQ== X-Received: from fawn.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5795]) (user=morbo job=sendgmr) by 2002:a62:e919:0:b0:51e:7b6e:5a3b with SMTP id j25-20020a62e919000000b0051e7b6e5a3bmr1529888pfh.78.1654813218119; Thu, 09 Jun 2022 15:20:18 -0700 (PDT) Date: Thu, 9 Jun 2022 22:16:27 +0000 In-Reply-To: <20220609221702.347522-1-morbo@google.com> Message-Id: <20220609221702.347522-9-morbo@google.com> Mime-Version: 1.0 References: <20220609221702.347522-1-morbo@google.com> X-Mailer: git-send-email 2.36.1.476.g0c4daa206d-goog Subject: [PATCH 08/12] cdrom: use correct format characters From: Bill Wendling To: isanbard@gmail.com Cc: Tony Luck , Borislav Petkov , Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Phillip Potter , Arnd Bergmann , Greg Kroah-Hartman , "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 , Ross Philipson , Daniel Kiper , 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 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Bill Wendling When compiling with -Wformat, clang emits the following warnings: drivers/cdrom/cdrom.c:3454:48: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security] ret = scnprintf(info + *pos, max_size - *pos, header); ^~~~~~ Use a string literal for the format string. Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Bill Wendling --- drivers/cdrom/cdrom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 416f723a2dbb..52b40120c76e 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -3451,7 +3451,7 @@ static int cdrom_print_info(const char *header, int val, char *info, struct cdrom_device_info *cdi; int ret; - ret = scnprintf(info + *pos, max_size - *pos, header); + ret = scnprintf(info + *pos, max_size - *pos, "%s", header); if (!ret) return 1;