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: <4F28E7A0.6000309@cn.fujitsu.com>
Date:	Wed, 01 Feb 2012 15:20:00 +0800
From:	Li Zefan <lizf@...fujitsu.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
CC:	David Miller <davem@...emloft.net>,
	netdev <netdev@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Cgroups <cgroups@...r.kernel.org>,
	Neil Horman <nhorman@...driver.com>,
	Herbert Xu <herbert@...dor.hengli.com.au>
Subject: Re: [PATCH 6/6] cls_cgroup: remove redundant rcu_read_lock/unlock

Cc: Herbert Xu <herbert@...dor.apana.org.au>

>> diff --git a/net/core/sock.c b/net/core/sock.c
>> index 213c856..c0bab23 100644
>> --- a/net/core/sock.c
>> +++ b/net/core/sock.c
>> @@ -1160,9 +1160,7 @@ void sock_update_classid(struct sock *sk)
>>  {
>>  	u32 classid;
>>  
>> -	rcu_read_lock();  /* doing current task, which cannot vanish. */
>>  	classid = task_cls_classid(current);
>> -	rcu_read_unlock();
>>  	if (classid && classid != sk->sk_classid)
>>  		sk->sk_classid = classid;
> 
> Yes, this seems fine.
> 
> Then, I wonder why we do the "if (classid && classid != sk->sk_classid)"
> 
> before the :
> 
> 	sk->sk_classid = classid;
> 
> This seems unnecessary checks.
> 

I was wondering about this too. He who added this may provide us with an
answer.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ