Re: [PATCH][SMACK] convert smack rule list to linux list

Tetsuo Handa
2009-02-22T11:40:44Z

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?