Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3018335pxj; Mon, 17 May 2021 15:42:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMA+D6njFKGrpbLoylzlA2LxDtxGLfEo+oR3fK+TMYM0OQtawuHlBWdJZGN/bBibGJ2liZ X-Received: by 2002:a17:907:7243:: with SMTP id ds3mr2312033ejc.100.1621291339531; Mon, 17 May 2021 15:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621291339; cv=none; d=google.com; s=arc-20160816; b=DigieMRHKOSYNCKJpCe06mJIv2n4nk0lYte2P1wEiDYToGYIz6MjOcKsyUtF2ozovx Ad+KPKoav0jAbb8ZtbKvB14DdAdomB/NrygCMTvIXwl56o6FHn/oepzFaATM89ixeGGh TF75oRMlc0F362xNvkEz/Dhea42HOe6moGR6/6vooftHw8TPK+yjesCNPQoRaINNBulq N6lmOjwaQ5rRm6BSRV1EeNOo3p5sLqDufikAmbz/mlHNK5EjOQVgYuXPHn4v0VZbf1st /QJILvUGpv3FiQ1AECFYddbxkNPvyRi7kWuHXJgFtnUBkzqNTgZWD7DgmkN/Xlx7VzH5 HLDA== 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=XoUrV4fYwZ5eDEDZAHf3H74xJLKyFJUn2zbmzoXxggk=; b=R+bqvUBSorwF8DOb7drlgDyDiXzBNgtO+WvWnI9RwQcE2MC7KoRI3ar7xCQiVOgZLs lyq23Y8ojM5o++9wASGXKP4nODGaxqjlBjJJd4Uz1V1OnJLVW07+S0dyJa1gJ2UryDE/ 9okKVWuC6kKcCkI8WuQ2tE6nb6KneIh5EWvF7EINlc2YQ+O8q1I7IJnkoh+9NMXG1qBB TKL9RfzcGZPHeRw+qTbfHcbzi7xoO/JEFj7mBzYKQGcWJXzo1TKdro2557SbMXJ6u/ZA 55yxqnywqc89Pw8XNv2HC413fIywNpOxp+ycD5mc7g0Y4Qko8Ax5af6TMpzrHhoe/7OU kVGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vl7fZWjY; 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 y31si2073018edy.186.2021.05.17.15.41.52; Mon, 17 May 2021 15:42:19 -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=vl7fZWjY; 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 S234443AbhEQOOx (ORCPT + 99 others); Mon, 17 May 2021 10:14:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:44548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238369AbhEQOMJ (ORCPT ); Mon, 17 May 2021 10:12:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 445F1613D8; Mon, 17 May 2021 14:08:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260482; bh=l6JtpswOXURGtwYZ5hYYWOergdQEDDoc8UI/xd6dLdg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vl7fZWjYGPF3ktAzSXnjLg6s+YL7pDHW1b5uW8Xg4WVUfWDwJOQ4mC2ZSc7MbJAq8 0vznBsJHM72Z9uLvdmg1aw13WRwTjyBIe6+IT8ckQVpUX+aZfad3Vg6fGAP+BztOlM 05cI/ZOWxacboEq/XBDrPR3zENkzbHGqq0vfjZbY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yaqi Chen , Alexei Starovoitov , Yonghong Song , Sasha Levin Subject: [PATCH 5.12 100/363] samples/bpf: Fix broken tracex1 due to kprobe argument change Date: Mon, 17 May 2021 15:59:26 +0200 Message-Id: <20210517140305.967244875@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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: Yaqi Chen [ Upstream commit 137733d08f4ab14a354dacaa9a8fc35217747605 ] >From commit c0bbbdc32feb ("__netif_receive_skb_core: pass skb by reference"), the first argument passed into __netif_receive_skb_core has changed to reference of a skb pointer. This commit fixes by using bpf_probe_read_kernel. Signed-off-by: Yaqi Chen Signed-off-by: Alexei Starovoitov Acked-by: Yonghong Song Link: https://lore.kernel.org/bpf/20210416154803.37157-1-chendotjs@gmail.com Signed-off-by: Sasha Levin --- samples/bpf/tracex1_kern.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/bpf/tracex1_kern.c b/samples/bpf/tracex1_kern.c index 3f4599c9a202..ef30d2b353b0 100644 --- a/samples/bpf/tracex1_kern.c +++ b/samples/bpf/tracex1_kern.c @@ -26,7 +26,7 @@ SEC("kprobe/__netif_receive_skb_core") int bpf_prog1(struct pt_regs *ctx) { - /* attaches to kprobe netif_receive_skb, + /* attaches to kprobe __netif_receive_skb_core, * looks for packets on loobpack device and prints them */ char devname[IFNAMSIZ]; @@ -35,7 +35,7 @@ int bpf_prog1(struct pt_regs *ctx) int len; /* non-portable! works for the given kernel only */ - skb = (struct sk_buff *) PT_REGS_PARM1(ctx); + bpf_probe_read_kernel(&skb, sizeof(skb), (void *)PT_REGS_PARM1(ctx)); dev = _(skb->dev); len = _(skb->len); -- 2.30.2