Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4831359ybl; Wed, 22 Jan 2020 05:33:07 -0800 (PST) X-Google-Smtp-Source: APXvYqwbC3oSa5ERV7G3cd/bok843NWgHJf/cudBpWYinUIffnidRkYxkj4YpMOw/CTra8uN/85Q X-Received: by 2002:a9d:7851:: with SMTP id c17mr7642391otm.58.1579699986913; Wed, 22 Jan 2020 05:33:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699986; cv=none; d=google.com; s=arc-20160816; b=S/InSqbP6gGbRCrKdJclP/aQUrj3KqZrMDwr8zs90k11S5wg6kifE7C+Zgwh1Wrogc SJZ+82lQwr/Ea1ia9t6QbOBoV7zevzivP2A6W7PoeZm1cCmVh8wexwNZE0vazkD/FEwp yo99kNMyH1SxOZ95YgKJbWNsPu7cGyit+RK5DUwXaWP4zybtBGvxHi9SllavZdwFRwWS Cjp+Eq3YhyXj5Yf6RqV624qM8lA1J0eUdfuNdAR8PnfwW1rhf8oLroV2PycTGOe6jUPC tIz6CY1uy4ox4yv+5SG5+QyoShZevx6Om+SObw/2+eyEWliIy/cCVyYpVZavcnrZ7wi6 326w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hyIoCjH1YO7TGB1pHa5n1Wwsi1ippBSGgX0wj23ptH8=; b=G2LMhH0+V2eUF5U4HM5v2UwE69fXCOWFIfAki48txxvZHwjXVpe2vuNTiFyyRb4KIu Bc3EFz9EJVUeCRdO4M/kleHG9Gq+bzfTzzsuoktcNV9x50oi0pPGCap9yRK7DDO+9vlB vB1ZDYgyE8HMQZFDYVB07fjCpQTOixiyDDhXTDaI1jd5RTtNxgWtDMs0rdtHd8wT6P/4 74hgnqIjlefHjiIbHjgKcDvv43IwThNDjF7wCOcuIjLCuRpxkmeLSqu2IFGJOpQkKpC1 TpwgIHU7tcnYFJH1+67cjE3G5ltPjaAsyVI+yno3yPoRgNkG/f4eLKZ+SvsCbmOxmH7q 9zew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="v+/m2BUN"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f204si18186328oia.43.2020.01.22.05.32.28; Wed, 22 Jan 2020 05:33:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="v+/m2BUN"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730401AbgAVNX3 (ORCPT + 99 others); Wed, 22 Jan 2020 08:23:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:41640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730747AbgAVNXZ (ORCPT ); Wed, 22 Jan 2020 08:23:25 -0500 Received: from localhost (unknown [84.241.205.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4473D205F4; Wed, 22 Jan 2020 13:23:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699404; bh=2fLv5w3+eifqC4KGzxoRe/B+TKlAwrj8u4H0SXcaz9Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v+/m2BUN/lC6pTTa+9HhS8MhIGlpf9kPFJTRMDpXfyAGy/uzt9ae3xS6jjKYoVQ2p SwAuzW6HB1B9fWw5zPhQF7oEGBtVzfUFG2x/6LaJzB+EVzexViYfnsnLKbruyOuQ6T st3ut/VLWrpX/JAQS+1KqlaOJqbVLj4x35crQp+s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin KaFai Lau , Alexei Starovoitov , Quentin Monnet Subject: [PATCH 5.4 134/222] bpftool: Fix printing incorrect pointer in btf_dump_ptr Date: Wed, 22 Jan 2020 10:28:40 +0100 Message-Id: <20200122092843.337350817@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Martin KaFai Lau commit 555089fdfc37ad65e0ee9b42ca40c238ff546f83 upstream. For plain text output, it incorrectly prints the pointer value "void *data". The "void *data" is actually pointing to memory that contains a bpf-map's value. The intention is to print the content of the bpf-map's value instead of printing the pointer pointing to the bpf-map's value. In this case, a member of the bpf-map's value is a pointer type. Thus, it should print the "*(void **)data". Fixes: 22c349e8db89 ("tools: bpftool: fix format strings and arguments for jsonw_printf()") Signed-off-by: Martin KaFai Lau Signed-off-by: Alexei Starovoitov Reviewed-by: Quentin Monnet Link: https://lore.kernel.org/bpf/20200110231644.3484151-1-kafai@fb.com Signed-off-by: Greg Kroah-Hartman --- tools/bpf/bpftool/btf_dumper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/bpf/bpftool/btf_dumper.c +++ b/tools/bpf/bpftool/btf_dumper.c @@ -26,7 +26,7 @@ static void btf_dumper_ptr(const void *d bool is_plain_text) { if (is_plain_text) - jsonw_printf(jw, "%p", data); + jsonw_printf(jw, "%p", *(void **)data); else jsonw_printf(jw, "%lu", *(unsigned long *)data); }