From 5c4904be41f32f315068e22af53b3fefdc87198a Mon Sep 17 00:00:00 2001
From: Tim Yamin <plasmaroo@gentoo.org>
Date: Mon, 7 Mar 2005 23:17:35 +0000
Subject: Add #7836[23] for 2.6. (Portage version: 2.0.51.19)

---
 sys-kernel/usermode-sources/ChangeLog              |  6 +-
 .../files/usermode-sources-2.6.78362.patch         | 73 ++++++++++++++++++++++
 .../usermode-sources-2.6.8.1-r9.ebuild             |  4 +-
 3 files changed, 81 insertions(+), 2 deletions(-)
 create mode 100644 sys-kernel/usermode-sources/files/usermode-sources-2.6.78362.patch

(limited to 'sys-kernel/usermode-sources')

diff --git a/sys-kernel/usermode-sources/ChangeLog b/sys-kernel/usermode-sources/ChangeLog
index 6d8113df6474..fc0f21c14d2c 100644
--- a/sys-kernel/usermode-sources/ChangeLog
+++ b/sys-kernel/usermode-sources/ChangeLog
@@ -1,6 +1,10 @@
 # ChangeLog for sys-kernel/usermode-sources
 # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-kernel/usermode-sources/ChangeLog,v 1.60 2005/03/07 23:10:16 plasmaroo Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/usermode-sources/ChangeLog,v 1.61 2005/03/07 23:17:35 plasmaroo Exp $
+
+  07 Mar 2005; <plasmaroo@gentoo.org> usermode-sources-2.6.8.1-r9.ebuild,
+  +files/usermode-sources-2.6.78362.patch:
+  Add #7836[23] for 2.6.
 
 *usermode-sources-2.6.8.1-r9 (07 Mar 2005)
 
diff --git a/sys-kernel/usermode-sources/files/usermode-sources-2.6.78362.patch b/sys-kernel/usermode-sources/files/usermode-sources-2.6.78362.patch
new file mode 100644
index 000000000000..77d32c3cc035
--- /dev/null
+++ b/sys-kernel/usermode-sources/files/usermode-sources-2.6.78362.patch
@@ -0,0 +1,73 @@
+# This is a BitKeeper generated diff -Nru style patch.
+#
+# ChangeSet
+#   2004/12/08 13:03:03-08:00 davem@nuts.davemloft.net 
+#   [NET]: CMSG compat code needs signedness fixes too.
+#   
+#   Signed-off-by: David S. Miller <davem@davemloft.net>
+# 
+# net/compat.c
+#   2004/12/08 13:02:32-08:00 davem@nuts.davemloft.net +7 -5
+#   [NET]: CMSG compat code needs signedness fixes too.
+# 
+# ChangeSet
+#   2004/12/10 09:52:42-08:00 torvalds@ppc970.osdl.org 
+#   Make sure VC resizing fits in s16.
+#   
+#   Noted by Georgi Guninski
+# 
+# drivers/char/vt.c
+#   2004/12/10 09:52:35-08:00 torvalds@ppc970.osdl.org +5 -0
+#   Make sure VC resizing fits in s16.
+# 
+diff -Nru a/net/compat.c b/net/compat.c
+--- a/net/compat.c	2005-02-15 11:46:30 -08:00
++++ b/net/compat.c	2005-02-15 11:46:30 -08:00
+@@ -124,6 +124,12 @@
+ 	 (struct compat_cmsghdr __user *)((msg)->msg_control) :		\
+ 	 (struct compat_cmsghdr __user *)NULL)
+ 
++#define CMSG_COMPAT_OK(ucmlen, ucmsg, mhdr) \
++	((ucmlen) >= sizeof(struct cmsghdr) && \
++	 (ucmlen) <= (unsigned long) \
++	 ((mhdr)->msg_controllen - \
++	  ((char *)(ucmsg) - (char *)(mhdr)->msg_control)))
++
+ static inline struct compat_cmsghdr __user *cmsg_compat_nxthdr(struct msghdr *msg,
+ 		struct compat_cmsghdr __user *cmsg, int cmsg_len)
+ {
+@@ -154,11 +160,7 @@
+ 			return -EFAULT;
+ 
+ 		/* Catch bogons. */
+-		if(CMSG_COMPAT_ALIGN(ucmlen) <
+-		   CMSG_COMPAT_ALIGN(sizeof(struct compat_cmsghdr)))
+-			return -EINVAL;
+-		if((unsigned long)(((char __user *)ucmsg - (char __user *)kmsg->msg_control)
+-				   + ucmlen) > kmsg->msg_controllen)
++		if (!CMSG_COMPAT_OK(ucmlen, ucmsg, kmsg))
+ 			return -EINVAL;
+ 
+ 		tmp = ((ucmlen - CMSG_COMPAT_ALIGN(sizeof(*ucmsg))) +
+diff -Nru a/drivers/char/vt.c b/drivers/char/vt.c
+--- a/drivers/char/vt.c	2005-02-15 11:46:59 -08:00
++++ b/drivers/char/vt.c	2005-02-15 11:46:59 -08:00
+@@ -768,6 +768,8 @@
+  * [this is to be used together with some user program
+  * like resize that changes the hardware videomode]
+  */
++#define VC_RESIZE_MAXCOL (32767)
++#define VC_RESIZE_MAXROW (32767)
+ int vc_resize(int currcons, unsigned int cols, unsigned int lines)
+ {
+ 	unsigned long old_origin, new_origin, new_scr_end, rlth, rrem, err = 0;
+@@ -779,6 +781,9 @@
+ 
+ 	if (!vc_cons_allocated(currcons))
+ 		return -ENXIO;
++
++	if (cols > VC_RESIZE_MAXCOL || lines > VC_RESIZE_MAXROW)
++		return -EINVAL;
+ 
+ 	new_cols = (cols ? cols : video_num_columns);
+ 	new_rows = (lines ? lines : video_num_lines);
diff --git a/sys-kernel/usermode-sources/usermode-sources-2.6.8.1-r9.ebuild b/sys-kernel/usermode-sources/usermode-sources-2.6.8.1-r9.ebuild
index ca80210604da..66793b7b5610 100644
--- a/sys-kernel/usermode-sources/usermode-sources-2.6.8.1-r9.ebuild
+++ b/sys-kernel/usermode-sources/usermode-sources-2.6.8.1-r9.ebuild
@@ -1,6 +1,6 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-kernel/usermode-sources/usermode-sources-2.6.8.1-r9.ebuild,v 1.1 2005/03/07 23:10:16 plasmaroo Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/usermode-sources/usermode-sources-2.6.8.1-r9.ebuild,v 1.2 2005/03/07 23:17:35 plasmaroo Exp $
 
 K_NOUSENAME="yes"
 ETYPE="sources"
@@ -29,6 +29,8 @@ UNIPATCH_LIST="${DISTDIR}/${UML_PATCH}.bz2
 	${FILESDIR}/${PN}-2.6.74070.patch
 	${FILESDIR}/${PN}-2.6.77666.patch
 	${FILESDIR}/${PN}-2.6.77923.patch
+	${FILESDIR}/${PN}-2.6.78362.patch
+	${FILESDIR}/${PN}-2.4.78363.patch
 	${FILESDIR}/${PN}-2.6.81106.patch
 	${FILESDIR}/${PN}-2.6.82141.patch"
 
-- 
cgit v1.2.3-65-gdbad