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]
Date:   Sat, 24 Sep 2022 11:01:13 -0400
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Song Liu <song@...nel.org>
Cc:     <linux-kernel@...r.kernel.org>, <kernel-team@...com>,
        "Naveen N . Rao" <naveen.n.rao@...ux.vnet.ibm.com>
Subject: Re: [PATCH] ftrace: fix recursive locking direct_mutex in
 ftrace_modify_direct_caller

On Mon, 19 Sep 2022 10:29:55 -0700
Song Liu <song@...nel.org> wrote:

> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 439e2ab6905e..d308d0674805 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -5461,7 +5461,7 @@ int __weak ftrace_modify_direct_caller(struct ftrace_func_entry *entry,
>  	if (ret)
>  		goto out_lock;
>  
> -	ret = register_ftrace_function(&stub_ops);
> +	ret = register_ftrace_function_nolock(&stub_ops);
>  	if (ret) {
>  		ftrace_set_filter_ip(&stub_ops, ip, 1, 0);
>  		goto out_lock;
> -- 

We need to update the comments to this function, as well add an:

#define lock_direct_assert_held()	lockdep_assert_held(&direct_mutex);

And call that in this function. Otherwise, we can be calling this code
without it held and cause races.

-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ