--- James Morris <[EMAIL PROTECTED]> wrote:
> Also,
>
> + mutex_lock(&smack_cipso_lock);
> +
> + for (scp = smack_cipso; scp != NULL; scp = scp->smk_next)
> + if (mapsmack == scp->smk_smack)
> + break;
> +
> + if (scp == NULL) {
> + scp = kzalloc(sizeof(struct smk_cipso_entry),
> + GFP_KERNEL);
> + if (scp == NULL) {
> + rc = -ENOMEM;
> + break;
> + }
> + scp->smk_next = smack_cipso;
> + scp->smk_smack = mapsmack;
> + scp->smk_level = maplevel;
> + scp->smk_catset = mapcatset;
> + wmb();
> + smack_cipso = scp;
> + /*
> + * Add this to ensure that there are enough bytes
> + * for the regurgitation
> + */
> + smk_cipso_written += sizeof(smack_t);
> + }
> +
> + mutex_unlock(&smack_cipso_lock);
>
> Why do you have a wmb() here ? The mutex lock acts as a full memory
> barrier.
Out come the wmb() calls. I'm still working on learning the details
of the locking models and I wasn't looking at a large enough scope
in the example to which I'd been pointed.
Thank you again.
Casey Schaufler
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe
linux-security-module" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html