Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2490254pxj; Mon, 10 May 2021 04:21:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVR+IU/3q3aq6etqxwUm92dbeLQE6Rvv1ffMGcYY5IBikl7HjbdZRzIuHnSH8QnsAZ5N9c X-Received: by 2002:a5d:8e03:: with SMTP id e3mr988438iod.60.1620645705195; Mon, 10 May 2021 04:21:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645705; cv=none; d=google.com; s=arc-20160816; b=r0ap9w+iiui+SbwGet+31ki6L18mphjKMDySJKTZu9sZVI/Q5qnzmfXEmv0eiN1KPF 0qqZNVaBTdoKNBl6EsNY2hp8zzyzTUrCplrkkbbL0MlvXuUAJedBrai9eJLiKnKdmtoW BH7K6buwzLZTWnEFVPQlAtJqOuH7zwBR3B90bU/57QPA2a61zkObk8tvQvk7NOKEsjc1 8qEfgaoFqOm3KPZ2S9AOiDSRQQdgBfP0l64cEjsVZWX9NEu7keAXRCD67MmRNl+Q5YY4 SUqPTwyyC7kRPkcNi8oncX1RMN95Kwf+l8e47vuIPMmdDOY+MJK9a6cMofp1uIva2REM pz5w== 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=b/c+DihNzyX4MRq6HFZyG6okk9qAYq7qFnWcMNfsGL0=; b=DdwXDPW1SOqHyYxuBX0ovvFVrDTGZ/M+dqQioWd1tpLB+ptglDRj5RYd/cYgfYAZdB 5E6SUkcXZBU6LT+uGRMqKSien3wAG4SheSOrNBEB/8Msnswy7E5wLP7EnvbciMfb28BZ inr2lZEvH6Y2HP5DuWzsw8bIqiF0PFGf5JUQbu1C4dEAXfaD6y+Rj7T22Qhn7C3A8LGM NgJEKe38LjgatweJuYXdXHO63KyPlElctdpYb3u8VFeEY7Gr07H9vkocXRR+BwoT5WT3 6VzvWo9iC2E6wpVDI9Q2mJNvyyY0/hSEQdq/VTTifh3q7GfhMNZ+T4O37o+6cLx1sJMS 79Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=VnjSJPrn; 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 w8si14985587jaw.8.2021.05.10.04.21.32; Mon, 10 May 2021 04:21:45 -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=VnjSJPrn; 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 S236731AbhEJLT7 (ORCPT + 99 others); Mon, 10 May 2021 07:19:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:46292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234002AbhEJKzn (ORCPT ); Mon, 10 May 2021 06:55:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 94E2F61C31; Mon, 10 May 2021 10:43:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643394; bh=WlA6ELO0SOrudtBqbfDBUkKbDE6xa4ZXqoENrvH0MAo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VnjSJPrnkJ9qPraHmZnRY6MnU2COJ+teEbW3uaJxrYTym+4zzEB1GabD0Hy9U7R3S PxqjIebGS8NFEMplcvljeZaSuy4GQdfhEaMpLZa2qBozqsdiHQOV4zg+0tjjDCNR8l hnfzBCG+gqwbQwsKKoyPUP2S3zJsogHO1joBv4ds= 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.10 297/299] lib/vsprintf.c: remove leftover f and F cases from bstr_printf() Date: Mon, 10 May 2021 12:21:34 +0200 Message-Id: <20210510102014.737290583@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@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 @@ -3102,8 +3102,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':