linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Francis Laniel <flaniel@linux.microsoft.com>,
	linux-trace-kernel@vger.kernel.org,
	Masami Hiramatsu <mhiramat@kernel.org>,
	stable@vger.kernel.org
Subject: Re: [PATCH v5 0/2] Return EADDRNOTAVAIL when func matches several symbols during kprobe creation
Date: Thu, 19 Oct 2023 21:18:43 +0900	[thread overview]
Message-ID: <20231019211843.56f292be3eee75cdd377e5a2@kernel.org> (raw)
In-Reply-To: <20231018130042.3430f000@gandalf.local.home>

On Wed, 18 Oct 2023 13:00:42 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Wed, 18 Oct 2023 17:40:28 +0300
> Francis Laniel <flaniel@linux.microsoft.com> wrote:
> 
> > Changes since:
> >  v1:
> >   * Use EADDRNOTAVAIL instead of adding a new error code.
> >   * Correct also this behavior for sysfs kprobe.
> >  v2:
> >   * Count the number of symbols corresponding to function name and return
> >   EADDRNOTAVAIL if higher than 1.
> >   * Return ENOENT if above count is 0, as it would be returned later by while
> >   registering the kprobe.
> >  v3:
> >   * Check symbol does not contain ':' before testing its uniqueness.
> >   * Add a selftest to check this is not possible to install a kprobe for a non
> >   unique symbol.
> >  v5:
> >   * No changes, just add linux-stable as recipient.
> 
> So why is this adding stable? (and as Greg's form letter states, that's not
> how you do that)
> 
> I don't see this as a fix but a new feature.

I asked him to make this a fix since the current kprobe event' behavior is
somewhat strange. It puts the probe on only the "first symbol" if user
specifies a symbol name which has multiple instances. In this case, the
actual probe address can not be solved by name. User must specify the
probe address by unique name + offset. Unless, it can put a probe on
unexpected address, especially if it specifies non-unique symbol + offset,
the address may NOT be the instruction boundary.
To avoid this issue, it should check the given symbol is unique.

Thank you,

> 
> -- Steve


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

  parent reply	other threads:[~2023-10-19 12:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-18 14:40 [PATCH v5 0/2] Return EADDRNOTAVAIL when func matches several symbols during kprobe creation Francis Laniel
2023-10-18 14:40 ` [PATCH v5 1/2] tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols Francis Laniel
2023-10-18 14:40 ` [PATCH v5 2/2] selftests/ftrace: Add new test case which checks non unique symbol Francis Laniel
2023-10-18 16:55   ` Greg KH
2023-10-18 17:00 ` [PATCH v5 0/2] Return EADDRNOTAVAIL when func matches several symbols during kprobe creation Steven Rostedt
2023-10-19  9:25   ` Francis Laniel
2023-10-19 12:18   ` Masami Hiramatsu [this message]
2023-10-19 13:51     ` Steven Rostedt
2023-10-19 15:07       ` Masami Hiramatsu
2023-10-20 10:42         ` Francis Laniel
2023-10-20 10:41       ` Francis Laniel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231019211843.56f292be3eee75cdd377e5a2@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=flaniel@linux.microsoft.com \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).