Some more fixes:
 
> diff -purN -X dontdiff linux-2.6.o/net/unix/af_unix.c linux-2.6.
> w/net/unix/af_unix.c
> --- linux-2.6.o/net/unix/af_unix.c   2006-06-21 00:02:30.000000000 -0400
> +++ linux-2.6.w/net/unix/af_unix.c   2006-06-27 09:30:12.000000000 -0400
> @@ -128,6 +128,28 @@ static atomic_t unix_nr_socks = ATOMIC_I
> 
>  #define UNIX_ABSTRACT(sk)   (unix_sk(sk)->addr->hash != UNIX_HASH_SIZE)
> 
> +#ifdef CONFIG_SECURITY_NETWORK
> +static void unix_get_peersec_dgram(struct sk_buff *skb)
> +{

add int err;

> +   err = security_socket_getpeersec_dgram(skb, UNIXSECDATA(skb),
> +                      UNIXSECLEN(skb));
> +   if (err)
> +      *(UNIXSEC(skb)) = NULL;

change to *(UNIXSECDATA(skb)) = NULL;

> +}
> +
> +static inline void unix_set_secdata(struct scm_cookie *scm, struct 
> sk_buff *skb)
> +{
> +   scm->secdata = *UNIXSECDATA(skb);
> +   scm->seclen = UNIXSECLEN(skb);

change to scm->seclen = *UNIXSECLEN(skb);

> +}
> +#else
> +static void unix_get_peersec_dgram(struct sk_buff *skb)
> +{ }
> +
> +static inline void unix_set_secdata(struct scm_cookie *scm, struct 
> sk_buff *skb)
> +{ }
> +#endif /* CONFIG_SECURITY_NETWORKING */
> +
>  /*
>   *  SMP locking strategy:
>   *    hash table is protected with spinlock unix_table_lock
> @@ -1291,6 +1313,8 @@ static int unix_dgram_sendmsg(struct kio
>     if (siocb->scm->fp)
>        unix_attach_fds(siocb->scm, skb);
> 
> +   unix_get_peersec_dgram(skb);
> +
>     skb->h.raw = skb->data;
>     err = memcpy_fromiovec(skb_put(skb,len), msg->msg_iov, len);
>     if (err)
> @@ -1570,6 +1594,7 @@ static int unix_dgram_recvmsg(struct kio
>        memset(&tmp_scm, 0, sizeof(tmp_scm));
>     }
>     siocb->scm->creds = *UNIXCREDS(skb);
> +   unix_set_secdata(siocb->scm, skb);
> 
>     if (!(flags & MSG_PEEK))
>     {

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to