]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/net/scm.h
net: Fix recursive descent in __scm_destroy().
[net-next-2.6.git] / include / net / scm.h
index 5637d5e22d5ff76012daf46ba30e04546d24a5bd..33e9986beb86dd95d6f3f962ca8a89281c874a9d 100644 (file)
@@ -4,16 +4,19 @@
 #include <linux/limits.h>
 #include <linux/net.h>
 #include <linux/security.h>
+#include <linux/pid.h>
+#include <linux/nsproxy.h>
 
 /* Well, we should have at least one descriptor open
  * to accept passed FDs 8)
  */
-#define SCM_MAX_FD     (OPEN_MAX-1)
+#define SCM_MAX_FD     255
 
 struct scm_fp_list
 {
-       int             count;
-       struct file     *fp[SCM_MAX_FD];
+       struct list_head        list;
+       int                     count;
+       struct file             *fp[SCM_MAX_FD];
 };
 
 struct scm_cookie
@@ -54,7 +57,7 @@ static __inline__ int scm_send(struct socket *sock, struct msghdr *msg,
        struct task_struct *p = current;
        scm->creds.uid = p->uid;
        scm->creds.gid = p->gid;
-       scm->creds.pid = p->tgid;
+       scm->creds.pid = task_tgid_vnr(p);
        scm->fp = NULL;
        scm->seq = 0;
        unix_get_peersec_dgram(sock, scm);