Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2555838pxj; Mon, 10 May 2021 05:51:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyS/u7AbPnqo558MkScPpoiYpWmhvCfJmVlXh6OC6/VjYSfsqnE+q/x4AzXtEPBx/nLqt11 X-Received: by 2002:a05:6638:1a9:: with SMTP id b9mr20885882jaq.97.1620651093572; Mon, 10 May 2021 05:51:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620651093; cv=none; d=google.com; s=arc-20160816; b=ulQtvj8OdEZeKXirLVFfyeSvXADqDOgXqWRnG3nN8fua/0tr2YU6tdZk3FelsIr9MD hNzE6r6tAOPRyPbbPFLmyBpFfSm6EbHJRBmk4d3onawmp1TpCVq0w86KMfKtqj8CGMIh k619fgPHeG6ZzZOrGexiyCaWOui2LFw9ezSQ51I1WQKFCFq6ChMjCrNNXZYXO2UOwBWQ 9vo0zNttp8KEpdxLSmEJOICub4/kmdzYYXsfLhII5FgC+IpuMuvPTDbNe8n1J0AkLHE8 9JsleKyKQVSrWqPjHWXpfhTN/KGTtcPqHCadl7Mc8ktF6WJT2buvQGtlZ3qKnnSKUl/o 9Ykw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TkNj325Gc7CyE2G3we3aSU09hnY1ka634pTtO/U7+RE=; b=sX9OAtauNZSix48ciLCR9My1+s0HuzIw9DDEd3iqFq2nfTMgiJWlvDoHzAYmzieXKT OCHFOazKFQeuVM3me8W2dVyfWCclxOqFNDtL+MW6+6EQDreRyb03cvqSi/C8H3/5cnil VNsEZTQY2wg2beS5maqoqaNZbuCiujcvR/NZq7ikxjvEC6eyWizO0/1tqaCduatMu/ya Pj0xLmoLC+12hASMIPOUiUixdJAgllQy/jgI4FGG69DaYjRtEXJ6VttAgLNRIVjwtonx aF9dQX3TEMF1ub15df4Gc0sls1XWkFH+tpKROD52+P0modgKBXckZbnigv9tCyt7ELKB 1Sfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cn9xK6Pj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w8si15124748jaw.8.2021.05.10.05.51.21; Mon, 10 May 2021 05:51:33 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cn9xK6Pj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348562AbhEJMp6 (ORCPT + 99 others); Mon, 10 May 2021 08:45:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:34362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238349AbhEJLR1 (ORCPT ); Mon, 10 May 2021 07:17:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7064161864; Mon, 10 May 2021 11:13:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620645188; bh=vTQ60BJQe6GY6v/2Ob/56JDciZsNrmdTbn0T8zmJIVY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cn9xK6PjG//uXSLdp5hgPbnfBzYW+9KBUk++EyS5Lgx65aKzID4V5s6pDTzSW5EuG WINemaY25EXZWjnvrn9lMYMCLxLyzM4raEe+PbDgj3hH0tu9xsBr49B1YVGoi02XlZ ds4l8O33Oc/qFj8SKtJ9LkC3T9PzTBzqq2pYDy+0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rasmus Villemoes , Sakari Ailus , Petr Mladek Subject: [PATCH 5.12 382/384] lib/vsprintf.c: remove leftover f and F cases from bstr_printf() Date: Mon, 10 May 2021 12:22:51 +0200 Message-Id: <20210510102027.382621995@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102014.849075526@linuxfoundation.org> References: <20210510102014.849075526@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rasmus Villemoes commit 84696cfaf4d90945eb2a8302edc6cf627db56b84 upstream. 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: Sakari Ailus Signed-off-by: Petr Mladek Link: https://lore.kernel.org/r/20210423094529.1862521-1-linux@rasmusvillemoes.dk Signed-off-by: Greg Kroah-Hartman --- lib/vsprintf.c | 2 -- 1 file changed, 2 deletions(-) --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -3135,8 +3135,6 @@ int bstr_printf(char *buf, size_t size, switch (*fmt) { case 'S': case 's': - case 'F': - case 'f': case 'x': case 'K': case 'e':