Merge tag 'block-5.13-2021-05-07' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / samples / bpf / tracex1_kern.c
index 3f4599c..ef30d2b 100644 (file)
@@ -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);