Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2519716pxj; Mon, 10 May 2021 05:05:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLnNxVY70eTaP9pA8wXw0sTfobWt2lNJfpPWUdQLoI9v4WtB1dcR8jHpRK2lNJp5MDtJF/ X-Received: by 2002:a5d:924b:: with SMTP id e11mr17864328iol.133.1620648325596; Mon, 10 May 2021 05:05:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620648325; cv=none; d=google.com; s=arc-20160816; b=sLUQbNX2uZ9gpPTdT0ib3/YN1wdRpGgBPbgZ/xm2/rJmvNQ7XCVuBE6YrpTnanknNu rb+Ed2qFkLuFiJ4lz3GVoeasvLQFMfM7gmJTvqUjeZUDlFFPXLdb82g8P6MtMBnkiCPB Ym3gosL4h09LD0/ZuRK5tzRZCHrnluoi/r6lUm59+oBn9TgKumP3S+G/fvXrkbbpLENT Q1TPc1yGC+naTnG1fWo4V5NBGCmq9Lcpk5OhM+4BcbNt0Bf+zb+IR+zHVe4li1WXcvwI txnaYAFW5bTnJgEF+xBPPCmK8akj1cTWh9F6s9XudxftLSdA4s9dLtVcA3nFWN4wDzGP mkZA== 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=yFJ9K5JMXOnxDOKgtntDM/d3RU4ZtxP5nVy/2qBp9gw=; b=Ki6QRLAfvNipZyYMQMTZ5SBl5e3C7ZOqXNeBABQ44J6II0kwXSPnPkmEJbygC1z1C5 uEepdOXcpmC6IqwogCo7WzMdLzR9NEHT+Afpw1z4iFdyPQnTf9ysCskxpecwcc7gdvmO VoKK8UaXjuZcnRPiGq4jeopF7E12rGABY2xz+qBoFhSOXknXdN3lHAxGum+1eDiq7GVw 3StnIdUBLupgRAxp0D0vEsPtRfcSbgOMt5UTpw6a8FHcHGdhRyY0bDdX/OUFOYaioudD ycEt3mcg21+ga7NiVZDekwfIjxdYexKMg4ilH1ytWxehlNJhJ/443rJbJkwy6vD5qcJJ 17AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="oERnNQF/"; 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 l11si588867ils.107.2021.05.10.05.05.12; Mon, 10 May 2021 05:05:25 -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="oERnNQF/"; 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 S244587AbhEJL73 (ORCPT + 99 others); Mon, 10 May 2021 07:59:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:40838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235947AbhEJLHC (ORCPT ); Mon, 10 May 2021 07:07:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D98A26190A; Mon, 10 May 2021 10:57:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620644228; bh=ahQev9HGYs11+GX2q1VKcRSLanEQ+OQUkZvga66ODYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oERnNQF/iqxytmbsuTfePtD5uLpijk7cY52Mv8mLz2esXUchtyxzXxMIulUrKy2i+ +KIvCu7PNHM5sjLMWwZR6LFN09jGYSrpaZo0DxEkSwkagSklrrv8BYUpdI44BTtBcm wtzwVTRCQJSjzB0SDb/FxHIL8qBGUktzS13QGDe0= 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.11 340/342] lib/vsprintf.c: remove leftover f and F cases from bstr_printf() Date: Mon, 10 May 2021 12:22:10 +0200 Message-Id: <20210510102021.343919869@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102010.096403571@linuxfoundation.org> References: <20210510102010.096403571@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 @@ -3103,8 +3103,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':