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: <1319087281.8416.45.camel@edumazet-laptop>
Date:	Thu, 20 Oct 2011 07:08:01 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	"Alex,Shi" <alex.shi@...el.com>
Cc:	Christoph Lameter <cl@...two.org>, "tj@...nel.org" <tj@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"Huang, Ying" <ying.huang@...el.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	"mingo@...hat.com" <mingo@...hat.com>,
	"avi@...hat.com" <avi@...hat.com>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	David Miller <davem@...emloft.net>,
	"kaber@...sh.net" <kaber@...sh.net>,
	"a.p.zijlstra@...llo.nl" <a.p.zijlstra@...llo.nl>,
	"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
	"jeremy@...source.com" <jeremy@...source.com>
Subject: Re: [PATCH] Code clean up for percpu_xxx() functions

Le jeudi 20 octobre 2011 à 10:44 +0800, Alex,Shi a écrit :
> > Acked-by: Christoph Lameter <cl@...two.org>
> 
> Thanks, Christoph! 
> and resend for code style problem correction. 
> 

Sorry this huge patch brings too many potential bugs.

I ask you a separate patch for the networking part, because I dont want
to Ack all the other parts.

> diff --git a/net/socket.c b/net/socket.c
> index ffe92ca..2845d38 100644
> --- a/net/socket.c
> +++ b/net/socket.c
> @@ -479,7 +479,7 @@ static struct socket *sock_alloc(void)
>  	inode->i_uid = current_fsuid();
>  	inode->i_gid = current_fsgid();
>  
> -	percpu_add(sockets_in_use, 1);
> +	__this_cpu_add(sockets_in_use, 1);

No, we are in process context, you need

	this_cpu_add(sockets_in_use, 1);

>  	return sock;
>  }
>  
> @@ -522,7 +522,7 @@ void sock_release(struct socket *sock)
>  	if (rcu_dereference_protected(sock->wq, 1)->fasync_list)
>  		printk(KERN_ERR "sock_release: fasync list not empty!\n");
>  
> -	percpu_sub(sockets_in_use, 1);
> +	__this_cpu_sub(sockets_in_use, 1);

	this_cpu_sub();

>  	if (!sock->file) {
>  		iput(SOCK_INODE(sock));
>  		return;



--
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