Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp335142pxj; Tue, 18 May 2021 04:36:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3X3ytDvOOqSN6MwPUIcYBRiuuubxxQp1OArd9+K3NQ0CzOYBOSyfkQyhpF6OW/mGJH3rh X-Received: by 2002:a05:6402:14c2:: with SMTP id f2mr6548208edx.69.1621337819125; Tue, 18 May 2021 04:36:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621337819; cv=none; d=google.com; s=arc-20160816; b=q1t5Ozu2sQ5oEMQBLl5wnGH0vnKFXT2mLxEGZhsk4mEZ9Uk5l4NqFPWQWPRORN0gu4 cdrGCMuHDAmRjfxAYQbNFBmwYKubp5XACOzsgJex3FHK+wJfPhWAd4PrdydNyC5ZmcUK fznkLUR+yQS08gxprD0umSmGWabhBDt2aJJfwUxTRuUZXCTIYU3rM34a6y3fMDLCCaDw WxAlMkUxB3MROTBAhQ+RObsEPrXL1dgBBrdfBz8RLgNXHYsLIpcQMAjTV2OGT5f6erR4 i+ptj81yN4+WlW7G13q4YKMXYyQwGuPkQgi4mrx9zO2I8fv9A3bEU0oOMmfX7/Z2YoYe nMTg== 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=Ru0/6E3kYGC4LULpNV6TD7nEhUCbydjgmE4uMMZuNmSy/SolFPJah+dmkapyZvjf4b 1lEPgDTFoywNJOWEPPU0Kz9yLR17QUZbbZ9HctXf+B3r4ZBfmgLKwz4GWwhS95yzl7/Y BuQRtvFiZDW8CvbvhVG8ETRWYJ4f0+k7d0rXKV040eQwQX1UbphICAZb37YkzSdcSE1w wMI9lHp1Td9S/peZIQ4WNLnbgM+lBPEK/E2C9mHLwtRGiksm16hC19XTXwlhE7x2ytkC UDR7jLytm1z4HZU5feJPvgVHDzOhtayL1GGYhEWinqO50Angg4VmkPjs77TEhETYbNlB j9lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JSgN+tpU; 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 d15si17595869edn.606.2021.05.18.04.36.34; Tue, 18 May 2021 04:36:59 -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=JSgN+tpU; 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 S244993AbhEQPWt (ORCPT + 99 others); Mon, 17 May 2021 11:22:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:34446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243262AbhEQPJb (ORCPT ); Mon, 17 May 2021 11:09:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B562061C3A; Mon, 17 May 2021 14:30:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261818; bh=l6JtpswOXURGtwYZ5hYYWOergdQEDDoc8UI/xd6dLdg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JSgN+tpUuGm5qFgCyw+xZqttzzwE6RPAKP/QMEqwTti4xnJKS7OBYfHtnJctF9Hu5 H77ELtL+Rb1bbv4/X85qKdGG5T/m5oPK83hYW/1lIqU2ycytt7WEO7jwd4bZHUfLPt W15c7dACEKK8aFuCK6ywJEBbtXuRUrMR5TcfardA= 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.10 071/289] samples/bpf: Fix broken tracex1 due to kprobe argument change Date: Mon, 17 May 2021 15:59:56 +0200 Message-Id: <20210517140307.587524829@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@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