mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Zheng Yejian <zhengyejian1@huawei.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [GIT PULL] probes: Fixes for v6.9-rc3
Date: Thu, 11 Apr 2024 10:09:18 +0900	[thread overview]
Message-ID: <20240411100918.15b7b8a7ad25718a9dffff91@kernel.org> (raw)

Hi Linus,

Probes fixes for v6.9-rc3:

- kprobes: Fix possible use-after-free issue on kprobe registration. Since
  check_kprobe_address_safe() uses `is_module_text_address()` and
  `__module_text_address()` separately, if the probe address is on an
  unloading module, the first `is_module_text_address()` return true but
  the second `__module_text_address()` returns NULL (module is unloaded
  between them). Thus it expects the probe is on the kernel text, and
  skips to get the module reference. In this case, when it arms a breakpoint
  on the probe address, it may cause a use-after-free problem.
  To fix this issue, we only use `__module_text_address()` once and tries
  to get reference of the module, if it fails, reject the probe.


Please pull the latest probes-fixes-v6.9-rc3 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
probes-fixes-v6.9-rc3

Tag SHA1: 67bbfb7d79488db2f7e80bc4442d090254127c3c
Head SHA1: 325f3fb551f8cd672dbbfc4cf58b14f9ee3fc9e8


Zheng Yejian (1):
      kprobes: Fix possible use-after-free issue on kprobe registration

----
 kernel/kprobes.c | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

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

             reply	other threads:[~2024-04-11  1:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-11  1:09 Masami Hiramatsu [this message]
2024-04-11  2:57 ` pr-tracker-bot

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=20240411100918.15b7b8a7ad25718a9dffff91@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=torvalds@linux-foundation.org \
    --cc=zhengyejian1@huawei.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

all inboxes | Powered by JetHome®