Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Miroslav Benes <mbenes@suse.cz>
To: Michael Vetter <mvetter@suse.com>
Cc: linux-kselftest@vger.kernel.org, live-patching@vger.kernel.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 3/3] selftests: livepatch: test livepatching a kprobed function
Date: Wed, 2 Oct 2024 17:29:01 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LSU.2.21.2410021724040.23724@pobox.suse.cz> (raw)
In-Reply-To: <20240930093308.65103-4-mvetter@suse.com>

Hi,

On Mon, 30 Sep 2024, Michael Vetter wrote:

> The test proves that a function that is being kprobed and uses a
> post_handler cannot be livepatched.
> 
> Only one ftrace_ops with FTRACE_OPS_FL_IPMODIFY set may be registered
> to any given function at a time.
> 
> Signed-off-by: Michael Vetter <mvetter@suse.com>

since my memory is short, I wondered why you need a separate module to 
register a kprobe for cmdline_proc_show() in vmlinux and why it cannot be 
achieved through tracefs. So... the test ensures that 
FTRACE_OPS_FL_IPMODIFY is exclusive. A kprobe sets FTRACE_OPS_FL_IPMODIFY 
flag if and only if post_handler is not NULL which also indicates a 
situation when regs->ip may be changed in that kprobe. This is something 
which cannot be done in tracefs and hence the module.

It was not clear to me from the changelog.

Miroslav

  reply	other threads:[~2024-10-02 15:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-30  9:33 [PATCH v4 0/3] selftests: livepatch: test livepatching a kprobed function Michael Vetter
2024-09-30  9:33 ` [PATCH v4 1/3] selftests: livepatch: rename KLP_SYSFS_DIR to SYSFS_KLP_DIR Michael Vetter
2024-10-02 15:23   ` Miroslav Benes
2024-09-30  9:33 ` [PATCH v4 2/3] selftests: livepatch: save and restore kprobe state Michael Vetter
2024-09-30  9:33 ` [PATCH v4 3/3] selftests: livepatch: test livepatching a kprobed function Michael Vetter
2024-10-02 15:29   ` Miroslav Benes [this message]
2024-10-02 13:55 ` [PATCH v4 0/3] " Marcos Paulo de Souza

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=alpine.LSU.2.21.2410021724040.23724@pobox.suse.cz \
    --to=mbenes@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=mvetter@suse.com \
    /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