Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1211915pxy; Fri, 23 Apr 2021 03:03:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFi2NZOFvMgZa3MBQizb28QdbWBqaW1Ebizk4tYQDgsVj1KBRpUdnN9m4sXW420pqtMBoS X-Received: by 2002:a17:90b:1b0d:: with SMTP id nu13mr4730473pjb.149.1619172183078; Fri, 23 Apr 2021 03:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619172183; cv=none; d=google.com; s=arc-20160816; b=o5ad+9AGFMovfBqNc6mrQlPXxYT3um/9eAc1VRfkROj9X4WTeetsKWBDApFTRYVe59 gf5pwMu3x/8obmCpSxOm5rshWUTQFbnIdSyUeo0UDj8ryOmfZeZoygWjGfLD1xrMarb8 HWMWaDT3qWlSHCfCLjB23THOQARK1EKvb9QTTaJ04XNqjvvnKEoeZ3LH6IZ+Edvk1nmN oMGWVXh7b9UHxp/8L0dbwlN90FtVDc1oVQWf66Sj2p8K0ZGBIW2AycXydv0/4arjOpWY mN45M9XBs/2G4hSowB+ZNubCwbttYkNv6mBrDJbXIfDx281J0VIjuq95Bn2q5S4N8v6z jzWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=mxrw4m0iZ2BOrmWgX/ufjMMS7U/p9Ei5D4V2YjpH7sg=; b=hlbNbt7YlcNYHYVFm2FllbSjRAbY8ppTUrgbS9Zso6Afl2DWqgD0N4Qvfc6La74kIf 4xYywADCoc9VfVny89rFor7blo+HOB2kirfIWS7pIVBMqpCiwOS9rxzOzragPuhgBzX9 sFtxou/C5HFm6a5INm5JQjyeAJ6rJc94UlwP66zu46+72TMgLYhZf6EaEU0hfbTY+T9W Wk3YManHVmWbf2+8KmasZp55rgTWuOHmMx9TsTgB8N+/re4SxBbLBLMR8xKJWHKhpog4 X0CTzEMUvVQlWfaNAPGJCvvEVzQgBeq+DR7hk8oQRrO/dxjpJ0QFd9RP+TT8wZUObCz3 yEsA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x8si5741861pfa.15.2021.04.23.03.02.46; Fri, 23 Apr 2021 03:03:03 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241717AbhDWKCc (ORCPT + 99 others); Fri, 23 Apr 2021 06:02:32 -0400 Received: from mga14.intel.com ([192.55.52.115]:54056 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230036AbhDWKCb (ORCPT ); Fri, 23 Apr 2021 06:02:31 -0400 IronPort-SDR: 9G4E3Ov8ssAf/hNOCMSTzMAy6OjXeohq6tQpfVoV4YnjIIGX8+FthmQPMri9FytpZUfpzcIE0O YkNH1tqouVHA== X-IronPort-AV: E=McAfee;i="6200,9189,9962"; a="195601753" X-IronPort-AV: E=Sophos;i="5.82,245,1613462400"; d="scan'208";a="195601753" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2021 03:01:52 -0700 IronPort-SDR: rAkZ9qqNlkzR9RQiI6kXoqh1DuQ9T70NQSncXM/J+MS347z6VVq5gTON5YXp36GbgmH22P8Rbr L0e+gVRln1XA== X-IronPort-AV: E=Sophos;i="5.82,245,1613462400"; d="scan'208";a="603499222" Received: from paasikivi.fi.intel.com ([10.237.72.42]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2021 03:01:49 -0700 Received: from paasikivi.fi.intel.com (localhost [127.0.0.1]) by paasikivi.fi.intel.com (Postfix) with SMTP id 66F5820207; Fri, 23 Apr 2021 13:01:46 +0300 (EEST) Date: Fri, 23 Apr 2021 13:01:46 +0300 From: Sakari Ailus To: Rasmus Villemoes Cc: Andrew Morton , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , "Rafael J. Wysocki" , 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: <20210423100146.GQ3@paasikivi.fi.intel.com> References: <20210423094529.1862521-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210423094529.1862521-1-linux@rasmusvillemoes.dk> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rasmus, On Fri, Apr 23, 2021 at 11:45:29AM +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 Thanks! Reviewed-by: Sakari Ailus > --- > 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': > -- > 2.29.2 > -- Sakari Ailus