Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3621017pxy; Mon, 26 Apr 2021 06:09:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwN1OvuMdK3o4FF5/uWZ3pIkN0xevHz5W5xVb1ZUWlaO35M+yzYtqqBu99dGBre1yUC/dg2 X-Received: by 2002:a17:906:8a86:: with SMTP id mu6mr18218934ejc.505.1619442567369; Mon, 26 Apr 2021 06:09:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619442567; cv=none; d=google.com; s=arc-20160816; b=GdDRclJUhlFclxIPeMbq/OT339seqvq2cubuJwEDOKkJN5QtZ3FVl+X8KUJsAMWNTK 33nCdVsQbQy/Txr6/Df6MQNMz/WvL8a9As15Z7AQkdyFkFitVaRuZrNosoFDopylVuYa OfACCV8vqPNC6uCKk9RBHoHiDLkNsNEmrZmP09aqP5ur+w6N2ilNleBNg0kGvDtyYXGS lD4QTK/wxT5RrY9BRdU8LyeD+Hfu54SUWWH1DvLNwQ4ngF5eONUG6RJWPuoImW+8LKP9 bEDnl9HupY+7lBMap1rmf3NkBeVVldQrYo07NcEI4FYWlmvFOsGwjMFiz2m6uT10PL39 fg3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=80Byng95bd3BbZGWzyUemGzr1KbWgfo5zBUOlFpQxMM=; b=NXqbPENXVAJ7qLSbUW37Xoi+Xrys1jVSIKKz4oq843GD9Bc6QDp6N6J7tEHrFF52B8 zySIwXArKtte17CZvK98hrPLiGV0QaRh63q7tIr4P0iXxEWT3TG7jmF9b3gzAeuZ1uFz 7vknKhLDrRkCxYkcvh4jLhZc4hih4E8j+aQodPI54K5EgwFD1GgfrdgN75zhmLp96Shc oDpxzHk0Lgl8eNoJNz6InKgK1q5oqElP8cwPiE2T1ChrBM2Zl00eOmeeVGd+Gjs7J9R/ BfzBOqCzoUM16n25BvA1Bi7th1FK6uvag5p3BGli6iSwKQaBz3n0Wsu/wKv2nmYZjREg 1EUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o10si13201197edc.254.2021.04.26.06.09.03; Mon, 26 Apr 2021 06:09:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233227AbhDZNIh (ORCPT + 99 others); Mon, 26 Apr 2021 09:08:37 -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: linux-kernel@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':