Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp2002147lfo; Sat, 28 May 2022 13:26:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDM38QGr3jBAleTD63TbMu72+eNIGRsvhhpwp6fcBdSGPllS1aUxqG/zh7OGdnefWP9xjd X-Received: by 2002:a65:5c0c:0:b0:3fa:b2c0:7935 with SMTP id u12-20020a655c0c000000b003fab2c07935mr20480367pgr.600.1653769577930; Sat, 28 May 2022 13:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653769577; cv=none; d=google.com; s=arc-20160816; b=wQ2BoyYiv1b8MfMSkQRI/p2pofO4GdiDf/pK1YDpXMBy9tdBc+0eSvW66XFYO5xngR sfhIq+5IFvLJAFgU6POT2RwcfDntLmnA+H7X8AdRyuX8n+1S4kbDGhm6TFptIGJikyDx vgzkxesSPzyvQmIC0gyixqp+seM1a4YxQB4JtU4ipr1fkuVWrtJEf7P7+Is4sMFY9ata 4mvMxbZNuElS9ZciWTgqYNbPY915p6zy21vr+QXGuMhuM1Dj86epBio1RJx3Uld5H2NS d8wPsx71Iz3w+/qL0KD+s5dR4jy5wJBowFfinTzvMdDiCTCGC0Aq7qnOyNGXZffzLPIt KsXQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=f+0uw7gg0XeHatCgitebVAVDfOU/0KBSimz2FDpWd90=; b=ncWn3I8+cuRwEUojkp8BI8mM/1qMifpVaYNiC2ekXuiDEWAfKdFlLJNvbSMmZs0wEB iyMcvaeA+yHWty/6qYaEEphsOxQ/3GJHfDcEpgZVUI+Sy8r1f0mGrK7l/aS0j++frYMR D+MY5HcR0+RqjMrr+7SAYRo+5sKBP0YMdwL0XpbD728IZn3WnoCFgcWEBTDMJTjhNKe9 qbCx+pxNtCY/+c4wTzrU3CFiZ4uHpxi/VBtT/iuJJxCAX35i9oV3FYOQhqBK8FAwyd0N UGOG8gj5xjABgmF5x4l9M3qcC9dNQGVH5cuG3pLIGNbX0seefiQl8uVhETZOOup2Ti/c kNng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eLtrHsjt; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id s6-20020a17090aba0600b001e26ef27651si6343510pjr.65.2022.05.28.13.26.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 13:26:17 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eLtrHsjt; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A7A715A2E7; Sat, 28 May 2022 12:33:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354640AbiE0U4Y (ORCPT + 99 others); Fri, 27 May 2022 16:56:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237744AbiE0U4W (ORCPT ); Fri, 27 May 2022 16:56:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0FA115FC0; Fri, 27 May 2022 13:56:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A8CEEB82522; Fri, 27 May 2022 20:56:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F714C385A9; Fri, 27 May 2022 20:56:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653684979; bh=ouLxdfpPr93wSzVLMEJWXsalJLxfF1Dpqw0Ygd5TG3U=; h=From:To:Cc:Subject:Date:From; b=eLtrHsjt76J6u2ihrMzg64T6VTrtgYFZ7JyOqOBXFuLeXlkWIPtO+Uu8utoGSXkN9 HAIhIOcB/8tgxaHVLoTQS8TLbSbeAfpdiWgHRg35b8sgeBRMDMiiQDwRUgAiSb7Fv2 g2eIj40wujY2zKxDTY3Kq5rRz31aRjbuWgWLzsBoUWlsK3yHFEzO/0fUk/LtOL20UE mQ4iTKknT+6s3fraTmGwZBoAzEbYUXfwlF9jyQq5wdp27vMTjNn+yr64ssq2kkii3B 2LDO3s7+YR/vo7KgoPejDWg2EOEFXMoXwwGzUNV5RZjaQ7ouVJrJYk3WTGgp8Bh0kf wEcFg5MK6Rm/g== From: Jiri Olsa To: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, lkml , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Steven Rostedt , Masami Hiramatsu Subject: [PATCH bpf-next 0/3] bpf: Fix cookie values for kprobe multi Date: Fri, 27 May 2022 22:56:08 +0200 Message-Id: <20220527205611.655282-1-jolsa@kernel.org> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi, there's bug in kprobe_multi link that makes cookies misplaced when using symbols to attach. The reason is that we sort symbols by name but not adjacent cookie values. Current test did not find it because bpf_fentry_test* are already sorted by name. thanks, jirka --- Jiri Olsa (3): selftests/bpf: Shuffle cookies symbols in kprobe multi test ftrace: Keep address offset in ftrace_lookup_symbols bpf: Force cookies array to follow symbols sorting kernel/trace/bpf_trace.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++--------------- kernel/trace/ftrace.c | 13 +++++++++++-- tools/testing/selftests/bpf/prog_tests/bpf_cookie.c | 78 +++++++++++++++++++++++++++++++++++++++--------------------------------------- tools/testing/selftests/bpf/progs/kprobe_multi.c | 24 ++++++++++++------------ 4 files changed, 112 insertions(+), 68 deletions(-)