Adding SELinux fixes for the AF_UNIX patch; bug #72317. Also fixing security bug...
authorTim Yamin <plasmaroo@gentoo.org>
Sun, 19 Dec 2004 20:27:50 +0000 (20:27 +0000)
committerTim Yamin <plasmaroo@gentoo.org>
Sun, 19 Dec 2004 20:27:50 +0000 (20:27 +0000)
sys-kernel/win4lin-sources/ChangeLog
sys-kernel/win4lin-sources/Manifest
sys-kernel/win4lin-sources/files/digest-win4lin-sources-2.6.9-r4 [moved from sys-kernel/win4lin-sources/files/digest-win4lin-sources-2.6.9-r3 with 100% similarity]
sys-kernel/win4lin-sources/files/win4lin-sources-2.6.9.AF_UNIX.SELinux.patch [new file with mode: 0644]
sys-kernel/win4lin-sources/files/win4lin-sources-2.6.9.CAN-2004-1151.patch [new file with mode: 0644]
sys-kernel/win4lin-sources/win4lin-sources-2.6.9-r4.ebuild [moved from sys-kernel/win4lin-sources/win4lin-sources-2.6.9-r3.ebuild with 90% similarity]

index 4b0b048b05f0663c9d06ceb90cd6634ef1a07478..b2e78ccc17ed89fe9d15bb3989d76dc25a175477 100644 (file)
@@ -1,6 +1,15 @@
 # ChangeLog for sys-kernel/win4lin-sources
 # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-kernel/win4lin-sources/ChangeLog,v 1.45 2004/12/04 00:19:09 plasmaroo Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/win4lin-sources/ChangeLog,v 1.46 2004/12/19 20:27:50 plasmaroo Exp $
+
+*win4lin-sources-2.6.9-r4 (19 Dec 2004)
+
+  19 Dec 2004; <plasmaroo@gentoo.org> -win4lin-sources-2.6.9-r3.ebuild,
+  +win4lin-sources-2.6.9-r4.ebuild,
+  +files/win4lin-sources-2.6.9.AF_UNIX.SELinux.patch,
+  +files/win4lin-sources-2.6.9.CAN-2004-1151.patch:
+  Adding SELinux fixes for the AF_UNIX patch; bug #72317. Also fixing security
+  bug #73000.
 
 *win4lin-sources-2.6.9-r3 (04 Dec 2004)
 
index 7808d556dddf07dfd6b8f9728ed2c260e1a3f87c..446a4f3ee25bf5628c7e3078a3ae60bb1fdb34db 100644 (file)
@@ -1,18 +1,20 @@
-MD5 4d01ebeb2c8fe8422064eddbceae6bd6 ChangeLog 10696
+MD5 0bdb8f08f792f06284af00f1d7466ffd ChangeLog 11045
+MD5 2ddd6ae6bc0fda0bc407e1a5063c533b win4lin-sources-2.6.9-r4.ebuild 1432
 MD5 608fe99985244b0445f76cee44c9ae14 metadata.xml 290
 MD5 2b671599525fa8f6972df4bf3130c139 win4lin-sources-2.4.26-r10.ebuild 2675
-MD5 d4c3642bd5419fa11e2fbaa81c5ed191 win4lin-sources-2.6.9-r3.ebuild 1354
 MD5 530630d25910e6bd9376b63ea099655f files/win4lin-sources-2.6.9.AF_UNIX.patch 469
 MD5 2b3ddb8b8b15f8da35ade38544b57857 files/win4lin-sources-2.4.26.XDRWrapFix.patch 1499
+MD5 2bd92617d5f73fe2973abc0ceb071fc5 files/digest-win4lin-sources-2.6.9-r4 207
+MD5 4d656fa3f3a47df751c0d78b64ed8353 files/win4lin-sources-2.6.9.AF_UNIX.SELinux.patch 1761
 MD5 53fe3d26f6fc45487d69895fc07770cb files/win4lin-sources-2.6.9.binfmt_elf.patch 2350
 MD5 8812f60b8d02b0b3b4c46a3311ddd851 files/win4lin-sources-2.6.9.smbfs.patch 2662
 MD5 a9991d6324d7404ed99e79be6e44e9de files/win4lin-sources-2.6.binfmt_elf.patch 2348
 MD5 c9da1bc82b906f6abc648c056e7bf662 files/win4lin-sources-2.4.26.FPULockup-53804.patch 354
 MD5 d1ccc2047be533c992f67270a150a210 files/win4lin-sources-2.4.26.cmdlineLeak.patch 388
 MD5 42b42f2a4f260fad2fef264b82aff2ae files/win4lin-sources-2.6.9.vma.patch 8952
+MD5 6bcdd0bb63e2db559a5c6465c73a7f89 files/win4lin-sources-2.6.9.CAN-2004-1151.patch 1143
 MD5 b0a1f80aff51d6601e8924329023b241 files/win4lin-sources.AF_UNIX.patch 515
 MD5 65254b087906bead43e7e7bf9eba7610 files/digest-win4lin-sources-2.4.26-r10 353
-MD5 2bd92617d5f73fe2973abc0ceb071fc5 files/digest-win4lin-sources-2.6.9-r3 207
 MD5 dc18e982f8149588a291956481885a8c files/win4lin-sources-2.4.26.CAN-2004-0495.patch 17549
 MD5 60d25ff310fc6abfdce39ec9e47345af files/win4lin-sources-2.4.26.CAN-2004-0685.patch 2809
 MD5 b9a94233e1457787352e5f85e3e3582d files/win4lin-sources-2.4.26.binfmt_a.out.patch 2009
diff --git a/sys-kernel/win4lin-sources/files/win4lin-sources-2.6.9.AF_UNIX.SELinux.patch b/sys-kernel/win4lin-sources/files/win4lin-sources-2.6.9.AF_UNIX.SELinux.patch
new file mode 100644 (file)
index 0000000..dbb8b23
--- /dev/null
@@ -0,0 +1,61 @@
+--- a/net/unix/af_unix.c       2004-10-18 22:54:37.000000000 +0100
++++ b/net/unix/af_unix.c       2004-12-19 18:33:12.000000000 +0000
+@@ -477,6 +477,8 @@
+                             struct msghdr *, size_t, int);
+ static int unix_dgram_connect(struct socket *, struct sockaddr *,
+                             int, int);
++static int unix_seqpacket_sendmsg(struct kiocb *, struct socket *,
++                                struct msghdr *, size_t);
+ 
+ static struct proto_ops unix_stream_ops = {
+       .family =       PF_UNIX,
+@@ -535,7 +537,7 @@
+       .shutdown =     unix_shutdown,
+       .setsockopt =   sock_no_setsockopt,
+       .getsockopt =   sock_no_getsockopt,
+-      .sendmsg =      unix_dgram_sendmsg,
++      .sendmsg =      unix_seqpacket_sendmsg,
+       .recvmsg =      unix_dgram_recvmsg,
+       .mmap =         sock_no_mmap,
+       .sendpage =     sock_no_sendpage,
+@@ -1365,9 +1367,11 @@
+       if (other->sk_shutdown & RCV_SHUTDOWN)
+               goto out_unlock;
+ 
+-      err = security_unix_may_send(sk->sk_socket, other->sk_socket);
+-      if (err)
+-              goto out_unlock;
++      if (sk->sk_type != SOCK_SEQPACKET) {
++              err = security_unix_may_send(sk->sk_socket, other->sk_socket);
++              if (err)
++                      goto out_unlock;
++      }
+ 
+       if (unix_peer(other) != sk &&
+           (skb_queue_len(&other->sk_receive_queue) >
+@@ -1517,6 +1521,25 @@
+       return sent ? : err;
+ }
+ 
++static int unix_seqpacket_sendmsg(struct kiocb *kiocb, struct socket *sock,
++                                struct msghdr *msg, size_t len)
++{
++      int err;
++      struct sock *sk = sock->sk;
++      
++      err = sock_error(sk);
++      if (err)
++              return err;
++
++      if (sk->sk_state != TCP_ESTABLISHED)
++              return -ENOTCONN;
++
++      if (msg->msg_namelen)
++              msg->msg_namelen = 0;
++
++      return unix_dgram_sendmsg(kiocb, sock, msg, len);
++}
++                                                                                            
+ static void unix_copy_addr(struct msghdr *msg, struct sock *sk)
+ {
+       struct unix_sock *u = unix_sk(sk);
diff --git a/sys-kernel/win4lin-sources/files/win4lin-sources-2.6.9.CAN-2004-1151.patch b/sys-kernel/win4lin-sources/files/win4lin-sources-2.6.9.CAN-2004-1151.patch
new file mode 100644 (file)
index 0000000..fc4289e
--- /dev/null
@@ -0,0 +1,35 @@
+--- 1.74/arch/x86_64/ia32/sys_ia32.c   2004-12-19 10:58:02 -08:00
++++ 1.75/arch/x86_64/ia32/sys_ia32.c   2004-12-19 10:58:02 -08:00
+@@ -525,11 +525,12 @@
+ int sys32_ni_syscall(int call)
+ { 
+       struct task_struct *me = current;
+-      static char lastcomm[8];
+-      if (strcmp(lastcomm, me->comm)) {
+-      printk(KERN_INFO "IA32 syscall %d from %s not implemented\n", call,
+-             current->comm);
+-              strcpy(lastcomm, me->comm); 
++      static char lastcomm[sizeof(me->comm)];
++
++      if (strncmp(lastcomm, me->comm, sizeof(lastcomm))) {
++              printk(KERN_INFO "IA32 syscall %d from %s not implemented\n",
++                     call, me->comm);
++              strncpy(lastcomm, me->comm, sizeof(lastcomm));
+       } 
+       return -ENOSYS;        
+ } 
+@@ -1125,11 +1126,11 @@
+ long sys32_vm86_warning(void)
+ { 
+       struct task_struct *me = current;
+-      static char lastcomm[8];
+-      if (strcmp(lastcomm, me->comm)) {
++      static char lastcomm[sizeof(me->comm)];
++      if (strncmp(lastcomm, me->comm, sizeof(lastcomm))) {
+               printk(KERN_INFO "%s: vm86 mode not supported on 64 bit kernel\n",
+                      me->comm);
+-              strcpy(lastcomm, me->comm); 
++              strncpy(lastcomm, me->comm, sizeof(lastcomm));
+       } 
+       return -ENOSYS;
+ } 
similarity index 90%
rename from sys-kernel/win4lin-sources/win4lin-sources-2.6.9-r3.ebuild
rename to sys-kernel/win4lin-sources/win4lin-sources-2.6.9-r4.ebuild
index 2dc82c7692e5d7dc2008009a6b82ba9e3ec7bea6..a552cde4b6662170abcda9a57ce9e2f5161b10f8 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-kernel/win4lin-sources/win4lin-sources-2.6.9-r3.ebuild,v 1.1 2004/12/04 00:19:09 plasmaroo Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/win4lin-sources/win4lin-sources-2.6.9-r4.ebuild,v 1.1 2004/12/19 20:27:50 plasmaroo Exp $
 
 ETYPE="sources"
 inherit kernel-2
@@ -14,6 +14,8 @@ UNIPATCH_LIST="
        ${FILESDIR}/${P}.binfmt_a.out.patch
        ${FILESDIR}/${P}.smbfs.patch
        ${FILESDIR}/${P}.AF_UNIX.patch
+       ${FILESDIR}/${P}.AF_UNIX.SELinux.patch
+       ${FILESDIR}/${P}.CAN-2004-1151.patch
        ${FILESDIR}/${P}.vma.patch"
 
 S=${WORKDIR}/linux-${KV}