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:   Mon, 27 Nov 2017 21:18:53 -0500
From:   Steven Rostedt <rostedt@...dmis.org>
To:     Alex Shi <alex.shi@...aro.org>
Cc:     linux-kernel@...r.kernel.org,
        linux-rt-users <linux-rt-users@...r.kernel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Carsten Emde <C.Emde@...dl.org>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        John Kacur <jkacur@...hat.com>,
        Paul Gortmaker <paul.gortmaker@...driver.com>,
        Julia Cartwright <julia@...com>,
        Daniel Wagner <daniel.wagner@...mens.com>,
        tom.zanussi@...ux.intel.com
Subject: Re: [PATCH RT 03/10] random: avoid preempt_disable()ed section

On Fri, 24 Nov 2017 14:26:40 +0800
Alex Shi <alex.shi@...aro.org> wrote:

> Hi Steve,
> 
> I just build the patches, a build error found here:
> 
> drivers/char/random.c: In function ‘get_random_int’:
> drivers/char/random.c:1816:7: error: assignment from incompatible
> pointer type [-Werror=incompatible-pointer-types]
>   hash = &get_locked_var(hash_entropy_int_lock, get_random_int_hash);
>        ^
> drivers/char/random.c: In function ‘get_random_long’:
> drivers/char/random.c:1838:7: error: assignment from incompatible
> pointer type [-Werror=incompatible-pointer-types]
>   hash = &get_locked_var(hash_entropy_int_lock, get_random_int_hash);
>        ^
> 
> > -	hash = get_cpu_var(get_random_int_hash);
> > +	hash = &get_locked_var(hash_entropy_int_lock, get_random_int_hash);  
>                ^
> Is this a extra '&' which need to remove?
> 
> >  
> >  	hash[0] += current->pid + jiffies + random_get_entropy();
> >  	md5_transform(hash, random_int_secret);
> >  	ret = hash[0];
> > -	put_cpu_var(get_random_int_hash);
> > +	put_locked_var(hash_entropy_int_lock, get_random_int_hash);
> >  
> >  	return ret;
> >  }
> > @@ -1833,12 +1835,12 @@ unsigned long get_random_long(void)
> >  	if (arch_get_random_long(&ret))
> >  		return ret;
> >  
> > -	hash = get_cpu_var(get_random_int_hash);
> > +	hash = &get_locked_var(hash_entropy_int_lock, get_random_int_hash);  
>                ^
> Ditto

Thanks! I made the following update. I forgot to check for warnings in
the build. :-/

-- Steve

diff --git a/drivers/char/random.c b/drivers/char/random.c
index b41745c5962c..46c0e27cf27f 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1813,7 +1813,7 @@ unsigned int get_random_int(void)
 	if (arch_get_random_int(&ret))
 		return ret;
 
-	hash = &get_locked_var(hash_entropy_int_lock, get_random_int_hash);
+	hash = get_locked_var(hash_entropy_int_lock, get_random_int_hash);
 
 	hash[0] += current->pid + jiffies + random_get_entropy();
 	md5_transform(hash, random_int_secret);
@@ -1835,7 +1835,7 @@ unsigned long get_random_long(void)
 	if (arch_get_random_long(&ret))
 		return ret;
 
-	hash = &get_locked_var(hash_entropy_int_lock, get_random_int_hash);
+	hash = get_locked_var(hash_entropy_int_lock, get_random_int_hash);
 
 	hash[0] += current->pid + jiffies + random_get_entropy();
 	md5_transform(hash, random_int_secret);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ