]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2024 09:08:21 +0000 (10:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Dec 2024 09:08:21 +0000 (10:08 +0100)
added patches:
selftests-bpf-add-netlink-helper-library.patch
selftests-bpf-remove-use-of-__xlated.patch
tracing-kprobes-skip-symbol-counting-logic-for-module-symbols-in-create_local_trace_kprobe.patch

queue-6.6/selftests-bpf-add-netlink-helper-library.patch [new file with mode: 0644]
queue-6.6/selftests-bpf-remove-use-of-__xlated.patch [new file with mode: 0644]
queue-6.6/series
queue-6.6/tracing-kprobes-skip-symbol-counting-logic-for-module-symbols-in-create_local_trace_kprobe.patch [new file with mode: 0644]

diff --git a/queue-6.6/selftests-bpf-add-netlink-helper-library.patch b/queue-6.6/selftests-bpf-add-netlink-helper-library.patch
new file mode 100644 (file)
index 0000000..01be235
--- /dev/null
@@ -0,0 +1,472 @@
+From 51f1892b5289f0c09745d3bedb36493555d6d90c Mon Sep 17 00:00:00 2001
+From: Daniel Borkmann <daniel@iogearbox.net>
+Date: Tue, 24 Oct 2023 23:49:03 +0200
+Subject: selftests/bpf: Add netlink helper library
+
+From: Daniel Borkmann <daniel@iogearbox.net>
+
+commit 51f1892b5289f0c09745d3bedb36493555d6d90c upstream.
+
+Add a minimal netlink helper library for the BPF selftests. This has been
+taken and cut down and cleaned up from iproute2. This covers basics such
+as netdevice creation which we need for BPF selftests / BPF CI given
+iproute2 package cannot cover it yet.
+
+Stanislav Fomichev suggested that this could be replaced in future by ynl
+tool generated C code once it has RTNL support to create devices. Once we
+get to this point the BPF CI would also need to add libmnl. If no further
+extensions are needed, a second option could be that we remove this code
+again once iproute2 package has support.
+
+Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
+Acked-by: Martin KaFai Lau <martin.lau@kernel.org>
+Link: https://lore.kernel.org/r/20231024214904.29825-7-daniel@iogearbox.net
+Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
+Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ tools/testing/selftests/bpf/Makefile          |   19 +
+ tools/testing/selftests/bpf/netlink_helpers.c |  358 ++++++++++++++++++++++++++
+ tools/testing/selftests/bpf/netlink_helpers.h |   46 +++
+ 3 files changed, 418 insertions(+), 5 deletions(-)
+ create mode 100644 tools/testing/selftests/bpf/netlink_helpers.c
+ create mode 100644 tools/testing/selftests/bpf/netlink_helpers.h
+
+--- a/tools/testing/selftests/bpf/Makefile
++++ b/tools/testing/selftests/bpf/Makefile
+@@ -590,11 +590,20 @@ endef
+ # Define test_progs test runner.
+ TRUNNER_TESTS_DIR := prog_tests
+ TRUNNER_BPF_PROGS_DIR := progs
+-TRUNNER_EXTRA_SOURCES := test_progs.c cgroup_helpers.c trace_helpers.c        \
+-                       network_helpers.c testing_helpers.c            \
+-                       btf_helpers.c flow_dissector_load.h            \
+-                       cap_helpers.c test_loader.c xsk.c disasm.c     \
+-                       json_writer.c unpriv_helpers.c                 \
++TRUNNER_EXTRA_SOURCES := test_progs.c         \
++                       cgroup_helpers.c       \
++                       trace_helpers.c        \
++                       network_helpers.c      \
++                       testing_helpers.c      \
++                       btf_helpers.c          \
++                       cap_helpers.c          \
++                       unpriv_helpers.c       \
++                       netlink_helpers.c      \
++                       test_loader.c          \
++                       xsk.c                  \
++                       disasm.c               \
++                       json_writer.c          \
++                       flow_dissector_load.h  \
+                        ip_check_defrag_frags.h
+ TRUNNER_EXTRA_FILES := $(OUTPUT)/urandom_read $(OUTPUT)/bpf_testmod.ko        \
+                      $(OUTPUT)/liburandom_read.so                     \
+--- /dev/null
++++ b/tools/testing/selftests/bpf/netlink_helpers.c
+@@ -0,0 +1,358 @@
++// SPDX-License-Identifier: GPL-2.0-or-later
++/* Taken & modified from iproute2's libnetlink.c
++ * Authors: Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
++ */
++#include <stdio.h>
++#include <stdlib.h>
++#include <unistd.h>
++#include <errno.h>
++#include <time.h>
++#include <sys/socket.h>
++
++#include "netlink_helpers.h"
++
++static int rcvbuf = 1024 * 1024;
++
++void rtnl_close(struct rtnl_handle *rth)
++{
++      if (rth->fd >= 0) {
++              close(rth->fd);
++              rth->fd = -1;
++      }
++}
++
++int rtnl_open_byproto(struct rtnl_handle *rth, unsigned int subscriptions,
++                    int protocol)
++{
++      socklen_t addr_len;
++      int sndbuf = 32768;
++      int one = 1;
++
++      memset(rth, 0, sizeof(*rth));
++      rth->proto = protocol;
++      rth->fd = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, protocol);
++      if (rth->fd < 0) {
++              perror("Cannot open netlink socket");
++              return -1;
++      }
++      if (setsockopt(rth->fd, SOL_SOCKET, SO_SNDBUF,
++                     &sndbuf, sizeof(sndbuf)) < 0) {
++              perror("SO_SNDBUF");
++              goto err;
++      }
++      if (setsockopt(rth->fd, SOL_SOCKET, SO_RCVBUF,
++                     &rcvbuf, sizeof(rcvbuf)) < 0) {
++              perror("SO_RCVBUF");
++              goto err;
++      }
++
++      /* Older kernels may no support extended ACK reporting */
++      setsockopt(rth->fd, SOL_NETLINK, NETLINK_EXT_ACK,
++                 &one, sizeof(one));
++
++      memset(&rth->local, 0, sizeof(rth->local));
++      rth->local.nl_family = AF_NETLINK;
++      rth->local.nl_groups = subscriptions;
++
++      if (bind(rth->fd, (struct sockaddr *)&rth->local,
++               sizeof(rth->local)) < 0) {
++              perror("Cannot bind netlink socket");
++              goto err;
++      }
++      addr_len = sizeof(rth->local);
++      if (getsockname(rth->fd, (struct sockaddr *)&rth->local,
++                      &addr_len) < 0) {
++              perror("Cannot getsockname");
++              goto err;
++      }
++      if (addr_len != sizeof(rth->local)) {
++              fprintf(stderr, "Wrong address length %d\n", addr_len);
++              goto err;
++      }
++      if (rth->local.nl_family != AF_NETLINK) {
++              fprintf(stderr, "Wrong address family %d\n",
++                      rth->local.nl_family);
++              goto err;
++      }
++      rth->seq = time(NULL);
++      return 0;
++err:
++      rtnl_close(rth);
++      return -1;
++}
++
++int rtnl_open(struct rtnl_handle *rth, unsigned int subscriptions)
++{
++      return rtnl_open_byproto(rth, subscriptions, NETLINK_ROUTE);
++}
++
++static int __rtnl_recvmsg(int fd, struct msghdr *msg, int flags)
++{
++      int len;
++
++      do {
++              len = recvmsg(fd, msg, flags);
++      } while (len < 0 && (errno == EINTR || errno == EAGAIN));
++      if (len < 0) {
++              fprintf(stderr, "netlink receive error %s (%d)\n",
++                      strerror(errno), errno);
++              return -errno;
++      }
++      if (len == 0) {
++              fprintf(stderr, "EOF on netlink\n");
++              return -ENODATA;
++      }
++      return len;
++}
++
++static int rtnl_recvmsg(int fd, struct msghdr *msg, char **answer)
++{
++      struct iovec *iov = msg->msg_iov;
++      char *buf;
++      int len;
++
++      iov->iov_base = NULL;
++      iov->iov_len = 0;
++
++      len = __rtnl_recvmsg(fd, msg, MSG_PEEK | MSG_TRUNC);
++      if (len < 0)
++              return len;
++      if (len < 32768)
++              len = 32768;
++      buf = malloc(len);
++      if (!buf) {
++              fprintf(stderr, "malloc error: not enough buffer\n");
++              return -ENOMEM;
++      }
++      iov->iov_base = buf;
++      iov->iov_len = len;
++      len = __rtnl_recvmsg(fd, msg, 0);
++      if (len < 0) {
++              free(buf);
++              return len;
++      }
++      if (answer)
++              *answer = buf;
++      else
++              free(buf);
++      return len;
++}
++
++static void rtnl_talk_error(struct nlmsghdr *h, struct nlmsgerr *err,
++                          nl_ext_ack_fn_t errfn)
++{
++      fprintf(stderr, "RTNETLINK answers: %s\n",
++              strerror(-err->error));
++}
++
++static int __rtnl_talk_iov(struct rtnl_handle *rtnl, struct iovec *iov,
++                         size_t iovlen, struct nlmsghdr **answer,
++                         bool show_rtnl_err, nl_ext_ack_fn_t errfn)
++{
++      struct sockaddr_nl nladdr = { .nl_family = AF_NETLINK };
++      struct iovec riov;
++      struct msghdr msg = {
++              .msg_name       = &nladdr,
++              .msg_namelen    = sizeof(nladdr),
++              .msg_iov        = iov,
++              .msg_iovlen     = iovlen,
++      };
++      unsigned int seq = 0;
++      struct nlmsghdr *h;
++      int i, status;
++      char *buf;
++
++      for (i = 0; i < iovlen; i++) {
++              h = iov[i].iov_base;
++              h->nlmsg_seq = seq = ++rtnl->seq;
++              if (answer == NULL)
++                      h->nlmsg_flags |= NLM_F_ACK;
++      }
++      status = sendmsg(rtnl->fd, &msg, 0);
++      if (status < 0) {
++              perror("Cannot talk to rtnetlink");
++              return -1;
++      }
++      /* change msg to use the response iov */
++      msg.msg_iov = &riov;
++      msg.msg_iovlen = 1;
++      i = 0;
++      while (1) {
++next:
++              status = rtnl_recvmsg(rtnl->fd, &msg, &buf);
++              ++i;
++              if (status < 0)
++                      return status;
++              if (msg.msg_namelen != sizeof(nladdr)) {
++                      fprintf(stderr,
++                              "Sender address length == %d!\n",
++                              msg.msg_namelen);
++                      exit(1);
++              }
++              for (h = (struct nlmsghdr *)buf; status >= sizeof(*h); ) {
++                      int len = h->nlmsg_len;
++                      int l = len - sizeof(*h);
++
++                      if (l < 0 || len > status) {
++                              if (msg.msg_flags & MSG_TRUNC) {
++                                      fprintf(stderr, "Truncated message!\n");
++                                      free(buf);
++                                      return -1;
++                              }
++                              fprintf(stderr,
++                                      "Malformed message: len=%d!\n",
++                                      len);
++                              exit(1);
++                      }
++                      if (nladdr.nl_pid != 0 ||
++                          h->nlmsg_pid != rtnl->local.nl_pid ||
++                          h->nlmsg_seq > seq || h->nlmsg_seq < seq - iovlen) {
++                              /* Don't forget to skip that message. */
++                              status -= NLMSG_ALIGN(len);
++                              h = (struct nlmsghdr *)((char *)h + NLMSG_ALIGN(len));
++                              continue;
++                      }
++                      if (h->nlmsg_type == NLMSG_ERROR) {
++                              struct nlmsgerr *err = (struct nlmsgerr *)NLMSG_DATA(h);
++                              int error = err->error;
++
++                              if (l < sizeof(struct nlmsgerr)) {
++                                      fprintf(stderr, "ERROR truncated\n");
++                                      free(buf);
++                                      return -1;
++                              }
++                              if (error) {
++                                      errno = -error;
++                                      if (rtnl->proto != NETLINK_SOCK_DIAG &&
++                                          show_rtnl_err)
++                                              rtnl_talk_error(h, err, errfn);
++                              }
++                              if (i < iovlen) {
++                                      free(buf);
++                                      goto next;
++                              }
++                              if (error) {
++                                      free(buf);
++                                      return -i;
++                              }
++                              if (answer)
++                                      *answer = (struct nlmsghdr *)buf;
++                              else
++                                      free(buf);
++                              return 0;
++                      }
++                      if (answer) {
++                              *answer = (struct nlmsghdr *)buf;
++                              return 0;
++                      }
++                      fprintf(stderr, "Unexpected reply!\n");
++                      status -= NLMSG_ALIGN(len);
++                      h = (struct nlmsghdr *)((char *)h + NLMSG_ALIGN(len));
++              }
++              free(buf);
++              if (msg.msg_flags & MSG_TRUNC) {
++                      fprintf(stderr, "Message truncated!\n");
++                      continue;
++              }
++              if (status) {
++                      fprintf(stderr, "Remnant of size %d!\n", status);
++                      exit(1);
++              }
++      }
++}
++
++static int __rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
++                     struct nlmsghdr **answer, bool show_rtnl_err,
++                     nl_ext_ack_fn_t errfn)
++{
++      struct iovec iov = {
++              .iov_base       = n,
++              .iov_len        = n->nlmsg_len,
++      };
++
++      return __rtnl_talk_iov(rtnl, &iov, 1, answer, show_rtnl_err, errfn);
++}
++
++int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
++            struct nlmsghdr **answer)
++{
++      return __rtnl_talk(rtnl, n, answer, true, NULL);
++}
++
++int addattr(struct nlmsghdr *n, int maxlen, int type)
++{
++      return addattr_l(n, maxlen, type, NULL, 0);
++}
++
++int addattr8(struct nlmsghdr *n, int maxlen, int type, __u8 data)
++{
++      return addattr_l(n, maxlen, type, &data, sizeof(__u8));
++}
++
++int addattr16(struct nlmsghdr *n, int maxlen, int type, __u16 data)
++{
++      return addattr_l(n, maxlen, type, &data, sizeof(__u16));
++}
++
++int addattr32(struct nlmsghdr *n, int maxlen, int type, __u32 data)
++{
++      return addattr_l(n, maxlen, type, &data, sizeof(__u32));
++}
++
++int addattr64(struct nlmsghdr *n, int maxlen, int type, __u64 data)
++{
++      return addattr_l(n, maxlen, type, &data, sizeof(__u64));
++}
++
++int addattrstrz(struct nlmsghdr *n, int maxlen, int type, const char *str)
++{
++      return addattr_l(n, maxlen, type, str, strlen(str)+1);
++}
++
++int addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data,
++            int alen)
++{
++      int len = RTA_LENGTH(alen);
++      struct rtattr *rta;
++
++      if (NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len) > maxlen) {
++              fprintf(stderr, "%s: Message exceeded bound of %d\n",
++                      __func__, maxlen);
++              return -1;
++      }
++      rta = NLMSG_TAIL(n);
++      rta->rta_type = type;
++      rta->rta_len = len;
++      if (alen)
++              memcpy(RTA_DATA(rta), data, alen);
++      n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len);
++      return 0;
++}
++
++int addraw_l(struct nlmsghdr *n, int maxlen, const void *data, int len)
++{
++      if (NLMSG_ALIGN(n->nlmsg_len) + NLMSG_ALIGN(len) > maxlen) {
++              fprintf(stderr, "%s: Message exceeded bound of %d\n",
++                      __func__, maxlen);
++              return -1;
++      }
++
++      memcpy(NLMSG_TAIL(n), data, len);
++      memset((void *) NLMSG_TAIL(n) + len, 0, NLMSG_ALIGN(len) - len);
++      n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + NLMSG_ALIGN(len);
++      return 0;
++}
++
++struct rtattr *addattr_nest(struct nlmsghdr *n, int maxlen, int type)
++{
++      struct rtattr *nest = NLMSG_TAIL(n);
++
++      addattr_l(n, maxlen, type, NULL, 0);
++      return nest;
++}
++
++int addattr_nest_end(struct nlmsghdr *n, struct rtattr *nest)
++{
++      nest->rta_len = (void *)NLMSG_TAIL(n) - (void *)nest;
++      return n->nlmsg_len;
++}
+--- /dev/null
++++ b/tools/testing/selftests/bpf/netlink_helpers.h
+@@ -0,0 +1,46 @@
++/* SPDX-License-Identifier: GPL-2.0-or-later */
++#ifndef NETLINK_HELPERS_H
++#define NETLINK_HELPERS_H
++
++#include <string.h>
++#include <linux/netlink.h>
++#include <linux/rtnetlink.h>
++
++struct rtnl_handle {
++      int                     fd;
++      struct sockaddr_nl      local;
++      struct sockaddr_nl      peer;
++      __u32                   seq;
++      __u32                   dump;
++      int                     proto;
++      FILE                    *dump_fp;
++#define RTNL_HANDLE_F_LISTEN_ALL_NSID         0x01
++#define RTNL_HANDLE_F_SUPPRESS_NLERR          0x02
++#define RTNL_HANDLE_F_STRICT_CHK              0x04
++      int                     flags;
++};
++
++#define NLMSG_TAIL(nmsg) \
++      ((struct rtattr *) (((void *) (nmsg)) + NLMSG_ALIGN((nmsg)->nlmsg_len)))
++
++typedef int (*nl_ext_ack_fn_t)(const char *errmsg, uint32_t off,
++                             const struct nlmsghdr *inner_nlh);
++
++int rtnl_open(struct rtnl_handle *rth, unsigned int subscriptions)
++            __attribute__((warn_unused_result));
++void rtnl_close(struct rtnl_handle *rth);
++int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
++            struct nlmsghdr **answer)
++            __attribute__((warn_unused_result));
++
++int addattr(struct nlmsghdr *n, int maxlen, int type);
++int addattr8(struct nlmsghdr *n, int maxlen, int type, __u8 data);
++int addattr16(struct nlmsghdr *n, int maxlen, int type, __u16 data);
++int addattr32(struct nlmsghdr *n, int maxlen, int type, __u32 data);
++int addattr64(struct nlmsghdr *n, int maxlen, int type, __u64 data);
++int addattrstrz(struct nlmsghdr *n, int maxlen, int type, const char *data);
++int addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data, int alen);
++int addraw_l(struct nlmsghdr *n, int maxlen, const void *data, int len);
++struct rtattr *addattr_nest(struct nlmsghdr *n, int maxlen, int type);
++int addattr_nest_end(struct nlmsghdr *n, struct rtattr *nest);
++#endif /* NETLINK_HELPERS_H */
diff --git a/queue-6.6/selftests-bpf-remove-use-of-__xlated.patch b/queue-6.6/selftests-bpf-remove-use-of-__xlated.patch
new file mode 100644 (file)
index 0000000..6685539
--- /dev/null
@@ -0,0 +1,53 @@
+From shung-hsi.yu@suse.com  Tue Dec 17 10:01:55 2024
+From: Shung-Hsi Yu <shung-hsi.yu@suse.com>
+Date: Tue, 17 Dec 2024 16:02:39 +0800
+Subject: selftests/bpf: remove use of __xlated()
+To: stable@vger.kernel.org, Sasha Levin <sashal@kernel.org>
+Cc: Eduard Zingerman <eddyz87@gmail.com>, Daniel Borkmann <daniel@iogearbox.net>, Martin KaFai Lau <martin.lau@kernel.org>, Shung-Hsi Yu <shung-hsi.yu@suse.com>
+Message-ID: <20241217080240.46699-3-shung-hsi.yu@suse.com>
+
+From: Shung-Hsi Yu <shung-hsi.yu@suse.com>
+
+Commit 68ec5395bc24, backport of mainline commit a41b3828ec05 ("selftests/bpf:
+Verify that sync_linked_regs preserves subreg_def") uses the __xlated() that
+wasn't in the v6.6 code-base, and causes BPF selftests to fail compilation.
+
+Remove the use of the __xlated() macro in
+tools/testing/selftests/bpf/progs/verifier_scalar_ids.c to fix compilation
+failure. Without the __xlated() checks the coverage is reduced, however the
+test case still functions just fine.
+
+Fixes: 68ec5395bc24 ("selftests/bpf: Verify that sync_linked_regs preserves subreg_def")
+Cc: Eduard Zingerman <eddyz87@gmail.com>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ tools/testing/selftests/bpf/progs/verifier_scalar_ids.c |   16 ----------------
+ 1 file changed, 16 deletions(-)
+
+--- a/tools/testing/selftests/bpf/progs/verifier_scalar_ids.c
++++ b/tools/testing/selftests/bpf/progs/verifier_scalar_ids.c
+@@ -682,22 +682,6 @@ __msg("from 3 to 4")
+ __msg("4: (77) r1 >>= 32                     ; R1_w=0")
+ __msg("5: (bf) r0 = r1                       ; R0_w=0 R1_w=0")
+ __msg("6: (95) exit")
+-/* Verify that statements to randomize upper half of r1 had not been
+- * generated.
+- */
+-__xlated("call unknown")
+-__xlated("r0 &= 2147483647")
+-__xlated("w1 = w0")
+-/* This is how disasm.c prints BPF_ZEXT_REG at the moment, x86 and arm
+- * are the only CI archs that do not need zero extension for subregs.
+- */
+-#if !defined(__TARGET_ARCH_x86) && !defined(__TARGET_ARCH_arm64)
+-__xlated("w1 = w1")
+-#endif
+-__xlated("if w0 < 0xa goto pc+0")
+-__xlated("r1 >>= 32")
+-__xlated("r0 = r1")
+-__xlated("exit")
+ __naked void linked_regs_and_subreg_def(void)
+ {
+       asm volatile (
index 07b1abfeea6c493fc63227eb8f7b4fc8cac85fd2..148ff1c64523d5d22192ba20d0dfbcdea3a43d45 100644 (file)
@@ -94,3 +94,6 @@ blk-iocost-avoid-using-clamp-on-inuse-in-__propagate.patch
 kselftest-arm64-abi-fix-svcr-detection.patch
 kvm-arm64-disable-mpam-visibility-by-default-and-ignore-vmm-writes.patch
 bpf-sync_linked_regs-must-preserve-subreg_def.patch
+tracing-kprobes-skip-symbol-counting-logic-for-module-symbols-in-create_local_trace_kprobe.patch
+selftests-bpf-add-netlink-helper-library.patch
+selftests-bpf-remove-use-of-__xlated.patch
diff --git a/queue-6.6/tracing-kprobes-skip-symbol-counting-logic-for-module-symbols-in-create_local_trace_kprobe.patch b/queue-6.6/tracing-kprobes-skip-symbol-counting-logic-for-module-symbols-in-create_local_trace_kprobe.patch
new file mode 100644 (file)
index 0000000..9008cbf
--- /dev/null
@@ -0,0 +1,42 @@
+From kniv@yandex-team.ru  Tue Dec 17 09:59:08 2024
+From: Nikolay Kuratov <kniv@yandex-team.ru>
+Date: Mon, 16 Dec 2024 14:19:23 +0300
+Subject: tracing/kprobes: Skip symbol counting logic for module symbols in create_local_trace_kprobe()
+To: stable@vger.kernel.org
+Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Masami Hiramatsu <mhiramat@kernel.org>, Francis Laniel <flaniel@linux.microsoft.com>, Steven Rostedt <rostedt@goodmis.org>, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, Nikolay Kuratov <kniv@yandex-team.ru>
+Message-ID: <20241216111923.2547104-1-kniv@yandex-team.ru>
+
+From: Nikolay Kuratov <kniv@yandex-team.ru>
+
+commit b022f0c7e404 ("tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols")
+avoids checking number_of_same_symbols() for module symbol in
+__trace_kprobe_create(), but create_local_trace_kprobe() should avoid this
+check too. Doing this check leads to ENOENT for module_name:symbol_name
+constructions passed over perf_event_open.
+
+No bug in newer kernels as it was fixed more generally by
+commit 9d8616034f16 ("tracing/kprobes: Add symbol counting check when module loads")
+
+Link: https://lore.kernel.org/linux-trace-kernel/20240705161030.b3ddb33a8167013b9b1da202@kernel.org
+Fixes: b022f0c7e404 ("tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols")
+Signed-off-by: Nikolay Kuratov <kniv@yandex-team.ru>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+v1 -> v2:
+ * Reword commit title and message
+ * Send for stable instead of mainline
+
+ kernel/trace/trace_kprobe.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/kernel/trace/trace_kprobe.c
++++ b/kernel/trace/trace_kprobe.c
+@@ -1814,7 +1814,7 @@ create_local_trace_kprobe(char *func, vo
+       int ret;
+       char *event;
+-      if (func) {
++      if (func && !strchr(func, ':')) {
+               unsigned int count;
+               count = number_of_same_symbols(func);