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: <20150723155816.GY3717@linux.vnet.ibm.com>
Date:	Thu, 23 Jul 2015 08:58:17 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Borislav Petkov <bp@...en8.de>
Cc:	X86-ML <x86@...nel.org>, Tony Luck <tony.luck@...el.com>,
	Aravind Gopalakrishnan <Aravind.Gopalakrishnan@....com>,
	LKML <linux-kernel@...r.kernel.org>,
	Linux EDAC <linux-edac@...r.kernel.org>
Subject: Re: [RFC PATCH 2/4] x86/mce: Rename rcu_dereference_check_mce() to
 mce_log_get_idx_check()

On Wed, Jul 22, 2015 at 10:40:26AM +0200, Borislav Petkov wrote:
> From: Borislav Petkov <bp@...e.de>
> 
> The "rcu_" prefix misleads for it being a proper RCU interface which
> is not. It basically checks whether we're preemptible or holding the
> chrdev_read mutex.
> 
> Rename it accordingly.
> 
> Signed-off-by: Borislav Petkov <bp@...e.de>
> Cc: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>

Acked-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>

> ---
>  arch/x86/kernel/cpu/mcheck/mce.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
> index 5a19adb86b8f..36c065e6fa94 100644
> --- a/arch/x86/kernel/cpu/mcheck/mce.c
> +++ b/arch/x86/kernel/cpu/mcheck/mce.c
> @@ -52,11 +52,11 @@
> 
>  static DEFINE_MUTEX(mce_chrdev_read_mutex);
> 
> -#define rcu_dereference_check_mce(p) \
> +#define mce_log_get_idx_check(p) \
>  ({ \
>  	rcu_lockdep_assert(rcu_read_lock_sched_held() || \
>  			   lockdep_is_held(&mce_chrdev_read_mutex), \
> -			   "suspicious rcu_dereference_check_mce() usage"); \
> +			   "suspicious mce_log_get_idx_check() usage"); \
>  	smp_load_acquire(&(p)); \
>  })
> 
> @@ -165,7 +165,7 @@ void mce_log(struct mce *mce)
>  	mce->finished = 0;
>  	wmb();
>  	for (;;) {
> -		entry = rcu_dereference_check_mce(mcelog.next);
> +		entry = mce_log_get_idx_check(mcelog.next);
>  		for (;;) {
> 
>  			/*
> @@ -1812,7 +1812,7 @@ static ssize_t mce_chrdev_read(struct file *filp, char __user *ubuf,
>  			goto out;
>  	}
> 
> -	next = rcu_dereference_check_mce(mcelog.next);
> +	next = mce_log_get_idx_check(mcelog.next);
> 
>  	/* Only supports full reads right now */
>  	err = -EINVAL;
> -- 
> 2.5.0.rc2.28.g6003e7f
> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ