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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49A14FBE.7020206@numericable.fr>
Date:	Sun, 22 Feb 2009 14:14:38 +0100
From:	etienne <etienne.basset@...ericable.fr>
To:	Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
CC:	casey@...aufler-ca.com, paul.moore@...com,
	linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH][SMACK] convert smack rule list to linux list

Tetsuo Handa wrote:
> etienne wrote:
>> diff --git a/security/smack/smack_access.c b/security/smack/smack_access.c
>> index 2e0b83e..3dc312d 100644
>> --- a/security/smack/smack_access.c
>> +++ b/security/smack/smack_access.c
>> @@ -87,7 +87,6 @@ static u32 smack_next_secid = 10;
>>  int smk_access(char *subject_label, char *object_label, int request)
>>  {
>>  	u32 may = MAY_NOT;
>> -	struct smk_list_entry *sp;
>>  	struct smack_rule *srp;
>>  
>>  	/*
>> @@ -139,8 +138,8 @@ int smk_access(char *subject_label, char *object_label, int request)
>>  	 * access (e.g. read is included in readwrite) it's
>>  	 * good.
>>  	 */
>> -	for (sp = smack_list; sp != NULL; sp = sp->smk_next) {
>> -		srp = &sp->smk_rule;
>> +
>> +	list_for_each_entry(srp, &smack_rule_list, list) {
>>  
>>  		if (srp->smk_subject == subject_label ||
>>  		    strcmp(srp->smk_subject, subject_label) == 0) {
> 
> Use of standard doubly linked list requires a lock, doesn't it?
> What lock protects smack_rule_list?
> 
you're right; 

what's the best way, using a rcu variant for "list_for_each, container_of ...etc" ?
(concurrent list insertion are already protected with a mutex, so rcu must the good idea for the read side) 


thanks,
Etienne
--
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