[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.1.10.0809051909230.2526@tundra.namei.org>
Date: Fri, 5 Sep 2008 19:12:02 +1000 (EST)
From: James Morris <jmorris@...ei.org>
To: Paul Moore <paul.moore@...com>
cc: selinux@...ho.nsa.gov, netdev@...r.kernel.org,
linux-security-module@...r.kernel.org
Subject: Re: [RFC PATCH v4 11/14] selinux: Cache NetLabel secattrs in the
socket's security struct
On Tue, 2 Sep 2008, Paul Moore wrote:
> /**
> + * selinux_netlbl_sock_genattr - Generate the NetLabel socket secattr
> + * @sk: the socket
> + * @sid: the socket's SID
> + *
> + * Description:
> + * Generate the NetLabel security attributes for a socket, making full use of
> + * the socket's attribute cache. Returns a pointer to the security attributes
> + * on success, negative values on failure.
Don't you mean NULL on failure?
> + *
> + */
> +static struct netlbl_lsm_secattr *selinux_netlbl_sock_genattr(struct sock *sk,
> + u32 sid)
> +{
> + int rc;
> + struct sk_security_struct *sksec = sk->sk_security;
> + struct netlbl_lsm_secattr *secattr;
> +
> + if (sksec->nlbl_secattr != NULL)
> + return sksec->nlbl_secattr;
> +
> + secattr = netlbl_secattr_alloc(GFP_ATOMIC);
> + if (secattr == NULL)
> + return NULL;
> + rc = security_netlbl_sid_to_secattr(sid, secattr);
> + if (rc != 0) {
> + netlbl_secattr_free(secattr);
> + return NULL;
> + }
> + sksec->nlbl_secattr = secattr;
> +
> + return secattr;
> +}
> +
Acked-by: James Morris <jmorris@...ei.org>
--
James Morris
<jmorris@...ei.org>
--
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