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 X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4BEADC43461 for ; Mon, 26 Apr 2021 13:07:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 12C0C61103 for ; Mon, 26 Apr 2021 13:07:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231876AbhDZNIg (ORCPT ); Mon, 26 Apr 2021 09:08:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:41986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231862AbhDZNIe (ORCPT ); Mon, 26 Apr 2021 09:08:34 -0400 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B80A861353; Mon, 26 Apr 2021 13:07:51 +0000 (UTC) Date: Mon, 26 Apr 2021 09:07:50 -0400 From: Steven Rostedt To: Rasmus Villemoes Cc: Andrew Morton , Petr Mladek , Sergey Senozhatsky , Andy Shevchenko , "Rafael J. Wysocki" , Sakari Ailus , stable@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] lib/vsprintf.c: remove leftover 'f' and 'F' cases from bstr_printf() Message-ID: <20210426090750.6be265d2@gandalf.local.home> In-Reply-To: <20210423094529.1862521-1-linux@rasmusvillemoes.dk> References: <20210423094529.1862521-1-linux@rasmusvillemoes.dk> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Fri, 23 Apr 2021 11:45:29 +0200 Rasmus Villemoes wrote: > Commit 9af7706492f9 ("lib/vsprintf: Remove support for %pF and %pf in > favour of %pS and %ps") removed support for %pF and %pf, and correctly > removed the handling of those cases in vbin_printf(). However, the > corresponding cases in bstr_printf() were left behind. > > In the same series, %pf was re-purposed for dealing with > fwnodes (3bd32d6a2ee6, "lib/vsprintf: Add %pfw conversion specifier > for printing fwnode names"). > > So should anyone use %pf with the binary printf routines, > vbin_printf() would (correctly, as it involves dereferencing the > pointer) do the string formatting to the u32 array, but bstr_printf() > would not copy the string from the u32 array, but instead interpret > the first sizeof(void*) bytes of the formatted string as a pointer - > which generally won't end well (also, all subsequent get_args would be > out of sync). > > Fixes: 9af7706492f9 ("lib/vsprintf: Remove support for %pF and %pf in favour of %pS and %ps") > Cc: stable@vger.kernel.org > Signed-off-by: Rasmus Villemoes > --- Reviewed-by: Steven Rostedt (VMware) Thanks! -- Steve > lib/vsprintf.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/lib/vsprintf.c b/lib/vsprintf.c > index 41ddc353ebb8..39ef2e314da5 100644 > --- a/lib/vsprintf.c > +++ b/lib/vsprintf.c > @@ -3135,8 +3135,6 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf) > switch (*fmt) { > case 'S': > case 's': > - case 'F': > - case 'f': > case 'x': > case 'K': > case 'e':