lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20260113104942.9eaed0b4c92e85ce33a368cb@kernel.org>
Date: Tue, 13 Jan 2026 10:49:42 +0900
From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
To: "Masami Hiramatsu (Google)" <mhiramat@...nel.org>
Cc: Steven Rostedt <rostedt@...dmis.org>, Naveen N Rao <naveen@...nel.org>,
 "David S . Miller" <davem@...emloft.net>, linux-kernel@...r.kernel.org,
 linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH] kprobes: Use dedicated kthread for kprobe optimizer

On Sat, 10 Jan 2026 23:33:47 +0900
"Masami Hiramatsu (Google)" <mhiramat@...nel.org> wrote:

> +static int kprobe_optimizer_thread(void *data)
> +{
> +	set_freezable();

Steve pointed that the kthread usually don't need to be freezable and
the workqueue is not freezable too. So I decided to remove this.

> +	while (!kthread_should_stop()) {
> +		wait_event_freezable(kprobe_optimizer_wait,
> +				     atomic_read(&optimizer_state) != OPTIMIZER_ST_IDLE ||
> +				     kthread_should_stop());
> +
> +		if (kthread_should_stop())
> +			break;
> +
> +		if (try_to_freeze())
> +			continue;
> +
> +		/*
> +		 * If it was a normal kick, wait for OPTIMIZE_DELAY.
> +		 * This wait can be interrupted by a flush request.
> +		 */
> +		if (atomic_read(&optimizer_state) == 1)
> +			wait_event_freezable_timeout(kprobe_optimizer_wait,
> +				atomic_read(&optimizer_state) == OPTIMIZER_ST_FLUSHING ||
> +				kthread_should_stop(),
> +				OPTIMIZE_DELAY);

Also, forgot to add kthread_should_stop() check here.

Let me update to v2.

Thanks,


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ