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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250701112116.24cf8163@batman.local.home>
Date: Tue, 1 Jul 2025 11:21:16 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Alexandre Ghiti <alex@...ti.fr>
Cc: Yao Zi <ziyao@...root.org>, Andy Chiu <andybnac@...il.com>,
 alexghiti@...osinc.com, palmer@...belt.com, Andy Chiu
 <andy.chiu@...ive.com>, Björn Töpel
 <bjorn@...osinc.com>, Mark Rutland <mark.rutland@....com>,
 puranjay12@...il.com, paul.walmsley@...ive.com, greentime.hu@...ive.com,
 nick.hu@...ive.com, nylon.chen@...ive.com, eric.lin@...ive.com,
 vicent.chen@...ive.com, zong.li@...ive.com, yongxuan.wang@...ive.com,
 samuel.holland@...ive.com, olivia.chu@...ive.com, c2232430@...il.com, Han
 Gao <rabenda.cn@...il.com>, Vivian Wang <wangruikang@...as.ac.cn>,
 linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
 regressions@...ts.linux.dev, linux-riscv@...ts.infradead.org
Subject: Re: [REGRESSION] Random oops on SG2042 with Linux 6.16-rc and
 dynamic ftrace

On Tue, 1 Jul 2025 14:27:32 +0200
Alexandre Ghiti <alex@...ti.fr> wrote:

> @@ -149,16 +157,17 @@ int ftrace_init_nop(struct module *mod, struct 
> dyn_ftrace *rec)
>          unsigned int nops[2], offset;
>          int ret;
> 
> +       mutex_lock(&text_mutex);

This looks like a prime candidate for:

	guard(mutex)(&text_mutex);

>          ret = ftrace_rec_set_nop_ops(rec);
>          if (ret)
> -               return ret;
> +               goto end;

Then this change wouldn't be needed.

> 
>          offset = (unsigned long) &ftrace_caller - pc;
>          nops[0] = to_auipc_t0(offset);
>          nops[1] = RISCV_INSN_NOP4;
> 
> -       mutex_lock(&text_mutex);
>          ret = patch_insn_write((void *)pc, nops, 2 * MCOUNT_INSN_SIZE);
> +end:
>          mutex_unlock(&text_mutex);

and "end:" as well as the mutex_unlock() can be removed.

> 
>          return ret;
> 
> 
> Andy is also taking a look, I'll let him confirm the above fix is correct.
> 
> Thanks for the thorough report!

Yes, thank you Yao Zi for the very detailed bug report! That made
things so much easier.

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ