Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp608129pxj; Thu, 20 May 2021 17:43:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzteW+kPufRxPKA3FODoFohEgIpBnOJI5bNQM8vaQI6pcD6rvK0rg93wIihQkaamkt1frgw X-Received: by 2002:a50:f418:: with SMTP id r24mr8150668edm.175.1621557826520; Thu, 20 May 2021 17:43:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621557826; cv=none; d=google.com; s=arc-20160816; b=HWXDDYbZZvbaU7CmnrL6KpmcG7CFgbcft/DUgAylTFAI4K6jfSWsHEcp/KwPzlcvus mTv36uVpSc/4ZRO3k674HHG+EJNwLWiF9kMhSe+4wxcsqf1Tlkyu9CJoAXw5/dxHXlxN tZ/NSsKXHfdoMoThDbFwmch6zIn96TiGxQU5JO+17FlHjiFy9sIa418VHJBANRwaF+4v cq//r76l2wnCU6cQr8fAk2mF8bg4253jkPqttzVMuDCcVPO4OsdS5PFIGXajbrW+lV71 TUKui6OmIXnf7tn3McudVft52eGEcFKx0ww/Z+SAO+JX9BLTXoWKtVAbIiQHcnW+fBQW w+Mw== 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=JU9KokC9TRx39t4ORIZ2zSk5kB35H0rtKEftEJX7tLBnNfi5MiTQGer0pM+57kB6KU KiHnpxRhAjBt/IcrXnShZvWjE4GfoWATLb5qWaNj1LPByXWP7BUVdLQQOUeqDPH44HHp 5eaKQLWewnxcVlr4kZMo7atDLs1H3g4WdEPSkLTUK/5T8MEKdTNYgNfaBAIkFtBmIlxi 5+NiXVGgSKp0228qfySyT+GlrIaJpvMA3JxKg5FXz2PSCB1vuunzVB15S1f5/adA/DO5 IRt3RkV2hT9G7VAl9idjYgbFe61CeGkcLLrTE7I3eWxaluxyXtKB+gzUYrgvYTZf9x87 39Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PmCwBZQj; 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 gh7si4015736ejb.387.2021.05.20.17.43.21; Thu, 20 May 2021 17:43:46 -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=PmCwBZQj; 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 S241544AbhETLYr (ORCPT + 99 others); Thu, 20 May 2021 07:24:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:40950 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239984AbhETLEc (ORCPT ); Thu, 20 May 2021 07:04:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9F59561D19; Thu, 20 May 2021 10:04:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505093; bh=RoA7G0ZmY5hKYB+MBB4C21QqDWguMEVxPPx+ofxXPxg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PmCwBZQjWZhFy8F8qw6q2szqKO9RICBMqMKHMB+409PSJwsHF7MN0FtbJk16tSGA3 RJpxqhLCCc0fs/oKJm3/rBDfOCti6Rt6RfVEnokJfjrtD1Bcn3IsCbCZx+UxY34WAy AuHqmtmuG4xZrpu1/brRbkuBOHhX+g/hOy4SQYqg= 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.9 185/240] samples/bpf: Fix broken tracex1 due to kprobe argument change Date: Thu, 20 May 2021 11:22:57 +0200 Message-Id: <20210520092114.865244055@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092108.587553970@linuxfoundation.org> References: <20210520092108.587553970@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