Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp382617pxj; Thu, 20 May 2021 11:30:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw4VqlJdtTjYTPLh14Z4CxLETYPIztcyqlucHQPFkwPoQqGQ9w8EVClX5A+5XLrLeXU9pS X-Received: by 2002:a50:eb89:: with SMTP id y9mr6513369edr.257.1621535438078; Thu, 20 May 2021 11:30:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621535438; cv=none; d=google.com; s=arc-20160816; b=K+VgLvgWI2/DRl5UM+f8R2JnJMCPee/kPhWQaNjjb7N6DeO4VyQfeLaYcLl7hOHIdb Hoa61h1mqMrM80qNl747cuCf8C5WMSMxeNxVi5bfavx2dCikWnFYTordEdhFEob0L7Um zp+j1tINgLOOmmkM5rxBPeMXEMHlbE8RIZ4HYGyW/t5egBQsGYy1KyAmXv3OWQwpl6DZ ZlNMfHSheClgcMPP5W8QNNkAeacPD7IBtqphmmv4HW7y+oeLzbBA1vdfKWcUFMTu3kSD YlgE3QaWL0LvAICadl0dEGS36DXkN/AxZ4U4sJ/BhDn4yi7iBaCq7Idy3i5D9QcK8fzp 6y4A== 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=Yxs6b60In9E3njm1otMTB5ddc0+Xd30kwqdQCY/RmxY=; b=MeXmHuwQdLMWedV/JT1XbI37uyfqpQMvgh3FFS6Q2GKZj0GHdtoZyyw3felfEDnU5p 9MQOxVj8G4IWCHvDPDUNWAJdbYwu1CelzivkjAHVEMwDhmPsML+SSyc0VN08Kpqi0yg1 yU8n6pH+ZW749NbD260PhMv6znw6XcN4G0E70YHGt/MyhzP4fLk9S2n2NJmSzNFBQlSy tQjn7K67+Fp0mePAFcF5ip5V/UsN6QOAXZovSMVdOQcUvQ+EbD6l07n/pyCfaQG3vllK ipD4uw7SkcESQCphA+S2C3ygUckURvnGMeFd3g5mg8V/SHO9FB05GtAQoZ+KW3C1m4Mw i1rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g8PnH4C9; 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 ha8si3162157ejb.488.2021.05.20.11.30.14; Thu, 20 May 2021 11:30:38 -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=g8PnH4C9; 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 S235000AbhETKTC (ORCPT + 99 others); Thu, 20 May 2021 06:19:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:42496 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235855AbhETKJg (ORCPT ); Thu, 20 May 2021 06:09:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AC703613DE; Thu, 20 May 2021 09:42:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503767; bh=RoA7G0ZmY5hKYB+MBB4C21QqDWguMEVxPPx+ofxXPxg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g8PnH4C93IINytBGKbgrSt0lJMhdiJD4/bNiMcjpzikS+EcYklMJ1If66Pzt8cUSP FCGKgLLXGgGEm0ORS3+Jvgtd5tU+od2gZzHbSa3TXrIvyPj7Qq9SMI8RYAeKnMm7dq jXgZ4GuD4AqWxMq87bglGbmdGn4F6GsYxvx4YFAw= 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 4.19 326/425] samples/bpf: Fix broken tracex1 due to kprobe argument change Date: Thu, 20 May 2021 11:21:35 +0200 Message-Id: <20210520092142.134662795@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@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 107da148820f..9c74b45c5720 100644 --- a/samples/bpf/tracex1_kern.c +++ b/samples/bpf/tracex1_kern.c @@ -20,7 +20,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]; @@ -29,7 +29,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