Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp2120015lkv; Thu, 20 May 2021 03:53:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVLoyCyMRgcaYMtIJWAIN5VjcRx58/9IPUeJrgiTu4qGsJgLl58KuXdriIUa601eIK10cY X-Received: by 2002:a05:6402:5193:: with SMTP id q19mr233702edd.167.1621508012247; Thu, 20 May 2021 03:53:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621508012; cv=none; d=google.com; s=arc-20160816; b=c/W5OwizpCDzqYeLING13bIqPMwuLkwxHRhugEKYANyqSpWnK9H5Qc5DFtlF9Ry2IN uW0VE+4zuWPQfxtdsyaoF02QjguaVmwQs513X4PiBO4q6LIJ0LLhiLfUBz/Yv0oOtI3N 5Jwu8keHRRDCJ4fh4NbXCHQammzF5szl54oSjoubsbLMvR8S7/TWvue37M89FGmh75f7 5dHlScWEpo8S7ZvxW/FIpL1hbUddplcaSDLnuvZmlG2hqWIE9IQX23H1CtZgQ6/xb8/n MLhRhbdEe+nRfotpKXYLGcAnA7n/CYfEtF+GOL8+YVYHrENcL3b5C3YVq6CTuD1JmFKu xoyQ== 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=AFyj8hWyAIvEALxRXBwiRULxADlghPQ5QcJLvBL0iFlB+dwYhYFrPqXOuwMxcCh8ph 6wf4pKW9s5LNZjBboBPPG6TdJ/Gk82jORexlQIARB9lm+ALOxBV9UtTVAQPJ33RHgWgm bXWZ1F0VojbsJ8BtSufMZCPL5+aeQvYorpG6QgpYXSXyFP5DZq3pheiiLAQii+ZKmElR gFc88JsC3+1UCAUaivHRyZh4Y/TyZsjRbYAIFcnNB7rjRpxqu4st8fVGOuA8HqJ41Pjp VBfX3In20pMS7D8/mND5hRAqYZJ0V0uglc841DNsKAkK4dozN5u4d5upeLivr+q/Tz/A 3fYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oQSNNhfP; 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 i2si2779630ejp.181.2021.05.20.03.53.07; Thu, 20 May 2021 03:53:32 -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=oQSNNhfP; 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 S237347AbhETKwc (ORCPT + 99 others); Thu, 20 May 2021 06:52:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:39656 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236293AbhETKga (ORCPT ); Thu, 20 May 2021 06:36:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ACFD061C67; Thu, 20 May 2021 09:54:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504451; bh=RoA7G0ZmY5hKYB+MBB4C21QqDWguMEVxPPx+ofxXPxg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oQSNNhfPBL26Fr4J2JZ7l5R4HVwjZr9OkQ/tSXFrhhWPHQholNs7sFss9DM/TOwhw uOsovZC5qrA6dtmtZ4Taxe972g4XnjUKBEKy4fqZfWlzNHP90IduebD8FkKxjwbRbC xVGV0RXqOBM7nEZsVm80QLEdyXarnXVIpyt8s8hI= 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.14 252/323] samples/bpf: Fix broken tracex1 due to kprobe argument change Date: Thu, 20 May 2021 11:22:24 +0200 Message-Id: <20210520092128.836954321@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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