public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: etienne <etienne.basset@numericable.fr>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: casey@schaufler-ca.com, paul.moore@hp.com,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH][SMACK] convert smack rule list to linux list
Date: Sun, 22 Feb 2009 14:14:38 +0100	[thread overview]
Message-ID: <49A14FBE.7020206@numericable.fr> (raw)
In-Reply-To: <200902222040.CAB86425.VMOQHFFFtOSLOJ@I-love.SAKURA.ne.jp>

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

  parent reply	other threads:[~2009-02-22 13:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-22 11:59 [PATCH][SMACK] convert smack rule list to linux list etienne
2009-02-22 11:40 ` Tetsuo Handa
2009-02-22 13:13   ` Tetsuo Handa
2009-02-22 15:28     ` Paul E. McKenney
2009-02-22 13:14   ` etienne [this message]
2009-02-22 13:31     ` Tetsuo Handa
2009-02-22 15:18       ` etienne
2009-02-22 15:31     ` Paul E. McKenney
2009-02-22 17:54       ` Casey Schaufler
2009-02-22 18:25         ` Paul E. McKenney
     [not found] <fa.JI7eCUCI0gjfyTdUdhIf4ZvZn1Q@ifi.uio.no>
     [not found] ` <fa.VIgNcVDTCE/wNXrAutvWzCWynf0@ifi.uio.no>
     [not found]   ` <fa.JLh+cst3ii911Hjql2Um0CktNnM@ifi.uio.no>
     [not found]     ` <fa.C6JdJ3BhdOO3tiGIAv+XuVpBjBk@ifi.uio.no>
2009-02-22 16:30       ` etienne
2009-02-22 18:24         ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49A14FBE.7020206@numericable.fr \
    --to=etienne.basset@numericable.fr \
    --cc=casey@schaufler-ca.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul.moore@hp.com \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox