Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1202421pxy; Fri, 23 Apr 2021 02:47:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyc79sChs9c2qG+NvvOkGONn+KUK1dRSA0OjZ45MyCKIY38RgHqJD3Mv+YfAAmxFV1B1Un8 X-Received: by 2002:a17:90a:b292:: with SMTP id c18mr4991592pjr.179.1619171223957; Fri, 23 Apr 2021 02:47:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619171223; cv=none; d=google.com; s=arc-20160816; b=pCRi49ek/q20Qh5sHh4+X9IZimYhyrNtj4BcVfoDULampaYowuSldG1yJq6hd0IU28 5u/Da9KiDWKG9fBD187uvSmlq0hcf89gfBVmFWuwyQmCI+sVZM8w/+3J7TrpEii0iSUQ xdslXOpSHehtRttLyhOTnEFUXwqTQy67nXiPOERbMNHr0gjgNNC3tF5iq1jW1HeRGx0L sayMRBcQNrtRB5TvOSbonyfr9hhwvvbXASZVP4yuFPbcxjmuD4tXEaTYMq3xE+ayvnuW iR2cj7GIl7mBOuCxVxyhugtes0zA3hh4/qQVMpm6plFhyWEAO5BpaDZHte/lpmXnKMpk 2cqQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=r9xL3vV7hsHxa0jz4RAzpmBQrBoUSRd61yPE89/kLfI=; b=YG3SxDVquKolKeuRgvk5qROcj5zbFbvZYk1cjjn90nFeCVqwzqTWYb8Gj85WLcqSSx GIMzhec0bV7qX7jvoR/1pPVdWeweG5HF8yTG9c6wm7f43kEI0iz+9SmuvqRyho2ZFs6e fXmmvzwCn0qItddI+Q+QYko3ErfabOTqB8xOA8NP/qW4IslKXOTyuvVU8dIVaSQ0dSuJ XZqyJJIiK4poC5IrukRRQlU9nW0HtdZzXgWymDedgADQLx/Vp2tx37zv1NqnOCVUbTDF a/KFh11aZTlZmfeLNr9ajrRnquagwtFc7dIPDU8zGAfDq7TytIh+/kROge3jLy37PVMm Yyrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=hQmx2Uwt; 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 x189si7096190pfx.257.2021.04.23.02.46.51; Fri, 23 Apr 2021 02:47: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; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=hQmx2Uwt; 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 S241935AbhDWJqT (ORCPT + 99 others); Fri, 23 Apr 2021 05:46:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241925AbhDWJqM (ORCPT ); Fri, 23 Apr 2021 05:46:12 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 785F9C061756 for ; Fri, 23 Apr 2021 02:45:34 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id v6so71672513ejo.6 for ; Fri, 23 Apr 2021 02:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=r9xL3vV7hsHxa0jz4RAzpmBQrBoUSRd61yPE89/kLfI=; b=hQmx2UwtN5nzyHTpzZR4WpzFjbFvhVjOWaMjU/09mS2hGvKIyJQSPZvtIFjj2jus7y n7Jzt6/7gKZ/yeRnqaH9KEPkj/xPDja2HF+TGTfF/Xm8DdeP/KyGBBeU0s2RwBSV8A3a 2dLYjPBng0pgYA+hgUXfnI7JtFEX1AARjG6WQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=r9xL3vV7hsHxa0jz4RAzpmBQrBoUSRd61yPE89/kLfI=; b=Y5qegTIdoH/LbzHOIQhR3mZTdBI7snU9kZMh9/DrQmxZoNG4oi1KutbBMtIJ0FSYug 3b0gQ5w3C5bCnG2KgAaoJCCEjV7W0LFo/E3OiNqI66krm+5E3w2/5GdlxCNt0m9u7dsU O0d8LtmK2cJytRLJOgDbOTutKZTAcegObmrV+MIGS2VMf7Y/Zhd3ZBA934N7fGkrVu5j Leoa7igSSrvSVxjsvy/7pUePK9J1ja93Qd9vaYCpGsIPX7Jkv3YzQPwrLD59PFAOci4c GQSlTjUTdYgoz/ryr+eUPwkr3Ynqe9KNx/h47VkBsaNl0SkwExhL55x7FLc/YXlKfUM/ apZQ== X-Gm-Message-State: AOAM532uHdgVUKBu+87E1tWoiCimLbGAXrKL55rZtBBpB3T/PCvj2H1L 96wQ9vzAbWFgxoawhGhep86udA== X-Received: by 2002:a17:907:76ae:: with SMTP id jw14mr3366109ejc.60.1619171133192; Fri, 23 Apr 2021 02:45:33 -0700 (PDT) Received: from prevas-ravi.prevas.se ([80.208.71.248]) by smtp.gmail.com with ESMTPSA id s13sm3574225ejz.110.2021.04.23.02.45.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Apr 2021 02:45:32 -0700 (PDT) From: Rasmus Villemoes To: Andrew Morton , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , Rasmus Villemoes , "Rafael J. Wysocki" , Sakari Ailus Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] lib/vsprintf.c: remove leftover 'f' and 'F' cases from bstr_printf() Date: Fri, 23 Apr 2021 11:45:29 +0200 Message-Id: <20210423094529.1862521-1-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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