## Automatically generated incremental diff
## From:   linux-2.2.19-pre15
## To:     linux-2.2.19-pre16
## Robot:  $Id: make-incremental-diff,v 1.8 2001/12/04 06:05:04 hpa Exp $

diff -urN linux-2.2.19-pre15/CREDITS linux/CREDITS
--- linux-2.2.19-pre15/CREDITS	Mon Dec  3 22:16:15 2001
+++ linux/CREDITS	Mon Dec  3 22:16:22 2001
@@ -806,11 +806,11 @@
 S: Canada
 
 N: Richard Günther
-E: richard.guenther@student.uni-tuebingen.de
+E: rguenth@tat.physik.uni-tuebingen.de
+W: http://www.tat.physik.uni-tuebingen.de/~rguenth
 P: 2048/2E829319 2F 83 FC 93 E9 E4 19 E2  93 7A 32 42 45 37 23 57
 D: binfmt_misc
-S: Fichtenweg 3/511
-S: 72076 Tübingen
+S: 72074 Tübingen
 S: Germany
 
 N: Danny ter Haar
diff -urN linux-2.2.19-pre15/Documentation/binfmt_misc.txt linux/Documentation/binfmt_misc.txt
--- linux-2.2.19-pre15/Documentation/binfmt_misc.txt	Tue Apr 28 14:22:03 1998
+++ linux/Documentation/binfmt_misc.txt	Mon Dec  3 22:16:22 2001
@@ -81,6 +81,6 @@
 
 
 There is a web page about binfmt_misc at
-http://www.anatom.uni-tuebingen.de/~richi/linux/binfmt_misc.html
+http://www.tat.physik.uni-tuebingen.de/~rguenth/linux/binfmt_misc.html
 
-Richard Günther, richard.guenther@student.uni-tuebingen.de
+Richard Günther <rguenth@tat.physik.uni-tuebingen.de>
diff -urN linux-2.2.19-pre15/Makefile linux/Makefile
--- linux-2.2.19-pre15/Makefile	Mon Dec  3 22:16:15 2001
+++ linux/Makefile	Mon Dec  3 22:16:22 2001
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 2
 SUBLEVEL = 19
-EXTRAVERSION = pre15
+EXTRAVERSION = pre16
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
 
diff -urN linux-2.2.19-pre15/arch/alpha/lib/strlen_user.S linux/arch/alpha/lib/strlen_user.S
--- linux-2.2.19-pre15/arch/alpha/lib/strlen_user.S	Tue Oct 26 17:53:39 1999
+++ linux/arch/alpha/lib/strlen_user.S	Mon Dec  3 22:16:22 2001
@@ -28,17 +28,9 @@
 	.set noat
 	.text
 
-	.globl __strlen_user
-	.ent __strlen_user
-	.frame sp, 0, ra
-
-	.align 3
-__strlen_user:
-	ldah	a1, 32767(zero)	# do not use plain strlen_user() for strings
-				# that might be almost 2 GB long; you should
-				# be using strnlen_user() instead
-
 	.globl __strnlen_user
+	.ent __strnlen_user
+	.frame sp, 0, ra
 
 	.align 3
 __strnlen_user:
@@ -89,4 +81,4 @@
 	subq	a1, t2, v0
 	ret
 
-	.end __strlen_user
+	.end __strnlen_user
diff -urN linux-2.2.19-pre15/arch/sparc/lib/strlen_user.S linux/arch/sparc/lib/strlen_user.S
--- linux-2.2.19-pre15/arch/sparc/lib/strlen_user.S	Tue Oct 26 17:53:39 1999
+++ linux/arch/sparc/lib/strlen_user.S	Mon Dec  3 22:16:22 2001
@@ -47,9 +47,7 @@
 	 mov	3, %o0
 
 	.align 4
-	.global C_LABEL(__strlen_user), C_LABEL(__strnlen_user)
-C_LABEL(__strlen_user):
-	sethi	%hi(32768), %o1
+	.global C_LABEL(__strnlen_user)
 C_LABEL(__strnlen_user):
 	mov	%o1, %g1
 	mov	%o0, %o1
diff -urN linux-2.2.19-pre15/arch/sparc64/kernel/sparc64_ksyms.c linux/arch/sparc64/kernel/sparc64_ksyms.c
--- linux-2.2.19-pre15/arch/sparc64/kernel/sparc64_ksyms.c	Mon Dec  3 22:16:15 2001
+++ linux/arch/sparc64/kernel/sparc64_ksyms.c	Mon Dec  3 22:16:22 2001
@@ -253,7 +253,6 @@
 #if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91)
 EXPORT_SYMBOL(strlen);
 #endif
-EXPORT_SYMBOL(__strlen_user);
 EXPORT_SYMBOL(strnlen);
 EXPORT_SYMBOL(strcpy);
 EXPORT_SYMBOL(strncpy);
diff -urN linux-2.2.19-pre15/arch/sparc64/lib/strlen_user.S linux/arch/sparc64/lib/strlen_user.S
--- linux-2.2.19-pre15/arch/sparc64/lib/strlen_user.S	Tue Oct 26 17:53:39 1999
+++ linux/arch/sparc64/lib/strlen_user.S	Mon Dec  3 22:16:22 2001
@@ -14,9 +14,7 @@
 #define HI_MAGIC 0x80808080
 
 	.align 4
-	.global __strlen_user, __strnlen_user
-__strlen_user:
-	sethi	%hi(32768), %o1
+	.global __strnlen_user
 __strnlen_user:	
 	mov	%o1, %g1
 	mov	%o0, %o1
diff -urN linux-2.2.19-pre15/drivers/net/Config.in linux/drivers/net/Config.in
--- linux-2.2.19-pre15/drivers/net/Config.in	Mon Dec  3 22:16:15 2001
+++ linux/drivers/net/Config.in	Mon Dec  3 22:16:22 2001
@@ -356,7 +356,7 @@
 #
 
 #  CONFIG_WAN_ROUTER is defined only when CONFIG_EXPERIMENTAL=y
-if [ "$CONFIG_EXPERIMENTAL" = y -a "$CONFIG_WAN_ROUTER" != "n" ]; then
+if [ "$CONFIG_EXPERIMENTAL" = "y" -a "$CONFIG_WAN_ROUTER" != "n" ]; then
   bool 'WAN drivers' CONFIG_WAN_DRIVERS 
   if [ "$CONFIG_WAN_DRIVERS" = "y" ]; then
     dep_tristate 'Sangoma WANPIPE(tm) multi-port cards: (select M not Y !)' CONFIG_VENDOR_SANGOMA $CONFIG_WAN_DRIVERS 
diff -urN linux-2.2.19-pre15/drivers/net/starfire.c linux/drivers/net/starfire.c
--- linux-2.2.19-pre15/drivers/net/starfire.c	Mon Dec  3 22:16:15 2001
+++ linux/drivers/net/starfire.c	Mon Dec  3 22:16:22 2001
@@ -49,6 +49,16 @@
 	LK1.2.4 (Ion Badulescu)
 	- More 2.2.x initialization fixes
 
+	LK1.2.5 (Ion Badulescu)
+	- Several fixes from Manfred Spraul
+
+	LK1.2.6 (Ion Badulescu)
+	- Fixed ifup/ifdown/ifup problem in 2.4.x
+
+	LK1.2.7 (Ion Badulescu)
+	- Removed unused code
+	- Made more functions static and __init
+
 TODO:
 	- implement tx_timeout() properly
 	- support ethtool
@@ -61,7 +71,7 @@
 " Updates and info at http://www.scyld.com/network/starfire.html\n";
 
 static const char version3[] =
-" (unofficial 2.2.x kernel port, version 1.2.4, February 11, 2001)\n";
+" (unofficial 2.2.x kernel port, version 1.2.7, February 26, 2001)\n";
 
 /* The user-configurable values.
    These may be modified when a driver module is loaded.*/
@@ -330,7 +340,7 @@
 #define pci_resource_flags(dev, i) \
   ((dev->base_address[i] & IORESOURCE_IO) ? IORESOURCE_IO : IORESOURCE_MEM)
 
-void * pci_get_drvdata (struct pci_dev *dev)
+static void * pci_get_drvdata (struct pci_dev *dev)
 {
 	int i;
 
@@ -341,7 +351,7 @@
 	return NULL;
 }
 
-void pci_set_drvdata (struct pci_dev *dev, void *driver_data)
+static void pci_set_drvdata (struct pci_dev *dev, void *driver_data)
 {
 	int i;
 
@@ -352,7 +362,7 @@
 		}
 }
 
-const struct pci_device_id *
+static const struct pci_device_id * __init
 pci_compat_match_device(const struct pci_device_id *ids, struct pci_dev *dev)
 {
 	u16 subsystem_vendor, subsystem_device;
@@ -372,7 +382,7 @@
 	return NULL;
 }
 
-static int
+static int __init
 pci_announce_device(struct pci_driver *drv, struct pci_dev *dev)
 {
 	const struct pci_device_id *id;
@@ -405,7 +415,7 @@
 	return 0;
 }
 
-int
+static int __init
 pci_register_driver(struct pci_driver *drv)
 {
 	struct pci_dev *dev;
@@ -424,7 +434,7 @@
 	return count;
 }
 
-void
+static void
 pci_unregister_driver(struct pci_driver *drv)
 {
 	struct pci_dev *dev;
@@ -447,14 +457,6 @@
 #endif
 }
 
-void *compat_request_region (unsigned long start, unsigned long n, const char *name)
-{
-	if (check_region (start, n) != 0)
-		return NULL;
-	request_region (start, n, name);
-	return (void *) 1;
-}
-
 static inline int pci_module_init(struct pci_driver *drv)
 {
 	if (pci_register_driver(drv))
@@ -483,6 +485,9 @@
 			func(dev); \
 	}
 
+#define netif_start_if(dev)	dev->start = 1
+#define netif_stop_if(dev)	dev->start = 0
+
 #else  /* LINUX_VERSION_CODE > 0x20300 */
 
 #define COMPAT_MOD_INC_USE_COUNT
@@ -493,6 +498,8 @@
 	dev->watchdog_timeo = timeout;
 #define kick_tx_timer(dev, func, timeout)
 
+#define netif_start_if(dev)
+#define netif_stop_if(dev)
 
 #endif /* LINUX_VERSION_CODE > 0x20300 */
 /* end of compatibility code */
@@ -658,7 +665,6 @@
 #endif
 };
 
-#define PRIV_ALIGN	15	/* Required alignment mask */
 struct rx_ring_info {
 	struct sk_buff *skb;
 	dma_addr_t mapping;
@@ -668,6 +674,7 @@
 	dma_addr_t first_mapping;
 };
 
+#define MII_CNT		2
 struct netdev_private {
 	/* Descriptor rings first for alignment. */
 	struct starfire_rx_desc *rx_ring;
@@ -704,7 +711,7 @@
 	/* MII transceiver section. */
 	int mii_cnt;			/* MII device addresses. */
 	u16 advertising;		/* NWay media advertisement */
-	unsigned char phys[2];		/* MII device addresses. */
+	unsigned char phys[MII_CNT];	/* MII device addresses. */
 };
 
 static int	mdio_read(struct net_device *dev, int phy_id, int location);
@@ -856,7 +863,7 @@
 	if (drv_flags & CanHaveMII) {
 		int phy, phy_idx = 0;
 		int mii_status;
-		for (phy = 0; phy < 32 && phy_idx < 4; phy++) {
+		for (phy = 0; phy < 32 && phy_idx < MII_CNT; phy++) {
 			mdio_write(dev, phy, 0, 0x8000);
 			udelay(500);
 			boguscnt = 1000;
@@ -1038,6 +1045,7 @@
 	if (dev->if_port == 0)
 		dev->if_port = np->default_port;
 
+	netif_start_if(dev);
 	netif_start_queue(dev);
 
 	if (debug > 1)
@@ -1709,7 +1717,8 @@
 	struct netdev_private *np = dev->priv;
 	int i;
 
-	netif_device_detach(dev);
+	netif_stop_queue(dev);
+	netif_stop_if(dev);
 
 	del_timer_sync(&np->timer);
 
diff -urN linux-2.2.19-pre15/drivers/s390/char/hwc_tty.c linux/drivers/s390/char/hwc_tty.c
--- linux-2.2.19-pre15/drivers/s390/char/hwc_tty.c	Sun Dec 10 16:49:42 2000
+++ linux/drivers/s390/char/hwc_tty.c	Mon Dec  3 22:16:22 2001
@@ -171,7 +171,9 @@
 
 	switch (cmd) {
 	case TIOCHWCTTYSINTRC:
-		count = strlen_user ((const char *) arg);
+		count = strnlen_user((const char *)arg, HWC_TTY_MAX_CNTL_SIZE);
+		if (!count)
+			return -EFAULT;
 		if (count > HWC_TTY_MAX_CNTL_SIZE)
 			return -EINVAL;
 		strncpy_from_user (hwc_tty_data.ioctl.intr_char,
diff -urN linux-2.2.19-pre15/drivers/usb/scanner.h linux/drivers/usb/scanner.h
--- linux-2.2.19-pre15/drivers/usb/scanner.h	Sun Dec 10 16:49:43 2000
+++ linux/drivers/usb/scanner.h	Mon Dec  3 22:16:23 2001
@@ -151,6 +151,7 @@
 		{ 0x04b8, 0x0101 },	/* Perfection 636U and 636Photo */
 		{ 0x04b8, 0x0103 },	/* Perfection 610 */
 		{ 0x04b8, 0x0104 },	/* Perfection 1200U and 1200Photo */
+		{ 0x04b8, 0x010b },	/* Perfection 1240U and 1240Photo */
 	/* Umax */
 		{ 0x1606, 0x0010 },	/* Astra 1220U */
 		{ 0x1606, 0x0002 },	/* Astra 1236U */
diff -urN linux-2.2.19-pre15/fs/binfmt_elf.c linux/fs/binfmt_elf.c
--- linux-2.2.19-pre15/fs/binfmt_elf.c	Mon Dec  3 22:16:16 2001
+++ linux/fs/binfmt_elf.c	Mon Dec  3 22:16:23 2001
@@ -113,6 +113,7 @@
 	char *k_platform, *u_platform;
 	long hwcap;
 	size_t platform_len = 0;
+	long len;
 
 	/*
 	 * Get hold of platform and hardware capabilities masks for
@@ -191,13 +192,21 @@
 	current->mm->arg_start = (unsigned long) p;
 	while (argc-->0) {
 		__put_user((elf_caddr_t)(unsigned long)p,argv++);
-		p += strlen_user(p);
+		len = strnlen_user(p, PAGE_SIZE*MAX_ARG_PAGES);
+		/* "can't happen" */
+		if (!len || len > PAGE_SIZE*MAX_ARG_PAGES)
+			return NULL;
+		p += len;
 	}
 	__put_user(NULL, argv);
 	current->mm->arg_end = current->mm->env_start = (unsigned long) p;
 	while (envc-->0) {
 		__put_user((elf_caddr_t)(unsigned long)p,envp++);
-		p += strlen_user(p);
+		len = strnlen_user(p, PAGE_SIZE*MAX_ARG_PAGES);
+		/* "can't happen" */
+		if (!len || len > PAGE_SIZE*MAX_ARG_PAGES)
+			return NULL;
+		p += len;
 	}
 	__put_user(NULL, envp);
 	current->mm->env_end = (unsigned long) p;
@@ -706,7 +715,7 @@
 				elf_interpreter);
 			kfree(elf_interpreter);
 			kfree(elf_phdata);
-			send_sig(SIGSEGV, current, 0);
+			force_sig(SIGSEGV, current);
 			return 0;
 		}
 
@@ -729,9 +738,6 @@
 	if (current->binfmt && current->binfmt->module)
 		__MOD_INC_USE_COUNT(current->binfmt->module);
 
-#ifndef VM_STACK_FLAGS
-	current->executable = dget(bprm->dentry);
-#endif
 	compute_creds(bprm);
 	current->flags &= ~PF_FORKNOEXEC;
 	bprm->p = (unsigned long)
@@ -742,6 +748,10 @@
 			load_addr, load_bias,
 			interp_load_addr,
 			(interpreter_type == INTERPRETER_AOUT ? 0 : 1));
+	if (!bprm->p) {
+		force_sig(SIGSEGV, current);
+		return 0;
+	}
 	/* N.B. passed_fileno might not be initialized? */
 	if (interpreter_type == INTERPRETER_AOUT)
 		current->mm->arg_start += strlen(passed_fileno) + 1;
diff -urN linux-2.2.19-pre15/fs/exec.c linux/fs/exec.c
--- linux-2.2.19-pre15/fs/exec.c	Mon Dec  3 22:16:16 2001
+++ linux/fs/exec.c	Mon Dec  3 22:16:23 2001
@@ -20,6 +20,9 @@
  * table to check for several different types  of binary formats.  We keep
  * trying until we recognize the file or we run out of supported binary
  * formats. 
+ *
+ * (current->executable doesn't exist anymore, procfs searches for the vma
+ * that corresponds to the executable and uses its dentry.)
  */
 
 #include <linux/config.h>
diff -urN linux-2.2.19-pre15/include/asm-alpha/siginfo.h linux/include/asm-alpha/siginfo.h
--- linux-2.2.19-pre15/include/asm-alpha/siginfo.h	Mon Apr 26 15:55:54 1999
+++ linux/include/asm-alpha/siginfo.h	Mon Dec  3 22:16:23 2001
@@ -89,8 +89,8 @@
 #define SI_ASYNCIO	-4	/* sent by AIO completion */
 #define SI_SIGIO	-5	/* sent by queued SIGIO */
 
-#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0)
-#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0)
+#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0 && (siptr)->si_code != SI_SIGIO)
+#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0 || (siptr)->si_code == SI_SIGIO)
 
 /*
  * SIGILL si_codes
diff -urN linux-2.2.19-pre15/include/asm-alpha/uaccess.h linux/include/asm-alpha/uaccess.h
--- linux-2.2.19-pre15/include/asm-alpha/uaccess.h	Wed Jun  7 14:26:44 2000
+++ linux/include/asm-alpha/uaccess.h	Mon Dec  3 22:16:23 2001
@@ -479,14 +479,6 @@
 	return ret;
 }
 
-/* Returns: 0 if bad, string length+1 (memory size) of string if ok */
-extern long __strlen_user(const char *);
-
-extern inline long strlen_user(const char *str)
-{
-	return access_ok(VERIFY_READ,str,0) ? __strlen_user(str) : 0;
-}
-
 /* Returns: 0 if exception before NUL or reaching the supplied limit (N),
  * a value greater than N if the limit would be exceeded, else strlen.  */
 extern long __strnlen_user(const char *, long);
diff -urN linux-2.2.19-pre15/include/asm-arm/siginfo.h linux/include/asm-arm/siginfo.h
--- linux-2.2.19-pre15/include/asm-arm/siginfo.h	Mon Apr 26 15:55:54 1999
+++ linux/include/asm-arm/siginfo.h	Mon Dec  3 22:16:23 2001
@@ -89,8 +89,8 @@
 #define SI_ASYNCIO	-4	/* sent by AIO completion */
 #define SI_SIGIO	-5	/* sent by queued SIGIO */
 
-#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0)
-#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0)
+#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0 && (siptr)->si_code != SI_SIGIO)
+#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0 || (siptr)->si_code == SI_SIGIO)
 
 /*
  * SIGILL si_codes
diff -urN linux-2.2.19-pre15/include/asm-arm/uaccess.h linux/include/asm-arm/uaccess.h
--- linux-2.2.19-pre15/include/asm-arm/uaccess.h	Sun Dec 10 16:49:44 2000
+++ linux/include/asm-arm/uaccess.h	Mon Dec  3 22:16:23 2001
@@ -121,8 +121,6 @@
 	return res;
 }
 
-#define strlen_user(s)	strnlen_user(s, ~0UL >> 1)
-
 extern __inline__ long strnlen_user (const char *s, long n)
 {
 	unsigned long res = 0;
diff -urN linux-2.2.19-pre15/include/asm-i386/siginfo.h linux/include/asm-i386/siginfo.h
--- linux-2.2.19-pre15/include/asm-i386/siginfo.h	Mon Apr 26 15:55:54 1999
+++ linux/include/asm-i386/siginfo.h	Mon Dec  3 22:16:23 2001
@@ -89,8 +89,8 @@
 #define SI_ASYNCIO	-4	/* sent by AIO completion */
 #define SI_SIGIO	-5	/* sent by queued SIGIO */
 
-#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0)
-#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0)
+#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0 && (siptr)->si_code != SI_SIGIO)
+#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0 || (siptr)->si_code == SI_SIGIO)
 
 /*
  * SIGILL si_codes
diff -urN linux-2.2.19-pre15/include/asm-i386/uaccess.h linux/include/asm-i386/uaccess.h
--- linux-2.2.19-pre15/include/asm-i386/uaccess.h	Mon Dec  3 22:16:16 2001
+++ linux/include/asm-i386/uaccess.h	Mon Dec  3 22:16:23 2001
@@ -597,7 +597,6 @@
 
 long strncpy_from_user(char *dst, const char *src, long count);
 long __strncpy_from_user(char *dst, const char *src, long count);
-#define strlen_user(str) strnlen_user(str, ~0UL >> 1)
 long strnlen_user(const char *str, long n);
 unsigned long clear_user(void *mem, unsigned long len);
 unsigned long __clear_user(void *mem, unsigned long len);
diff -urN linux-2.2.19-pre15/include/asm-m68k/siginfo.h linux/include/asm-m68k/siginfo.h
--- linux-2.2.19-pre15/include/asm-m68k/siginfo.h	Wed Aug 19 13:24:44 1998
+++ linux/include/asm-m68k/siginfo.h	Mon Dec  3 22:16:23 2001
@@ -89,8 +89,8 @@
 #define SI_ASYNCIO	-4	/* sent by AIO completion */
 #define SI_SIGIO	-5	/* sent by queued SIGIO */
 
-#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0)
-#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0)
+#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0 && (siptr)->si_code != SI_SIGIO)
+#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0 || (siptr)->si_code == SI_SIGIO)
 
 /*
  * SIGILL si_codes
diff -urN linux-2.2.19-pre15/include/asm-m68k/uaccess.h linux/include/asm-m68k/uaccess.h
--- linux-2.2.19-pre15/include/asm-m68k/uaccess.h	Sun Dec 10 16:49:44 2000
+++ linux/include/asm-m68k/uaccess.h	Mon Dec  3 22:16:23 2001
@@ -801,7 +801,6 @@
  *
  * Return 0 for error
  */
-#define strlen_user(str) strnlen_user(str, ~0UL >> 1)
 static inline long strnlen_user(const char * src, long n)
 {
     long res = -(long) src;
diff -urN linux-2.2.19-pre15/include/asm-mips/siginfo.h linux/include/asm-mips/siginfo.h
--- linux-2.2.19-pre15/include/asm-mips/siginfo.h	Mon Aug  9 12:04:41 1999
+++ linux/include/asm-mips/siginfo.h	Mon Dec  3 22:16:23 2001
@@ -97,8 +97,8 @@
 #define SI_MESGQ	-4	/* sent by real time mesq state change */
 #define SI_SIGIO	-5	/* sent by queued SIGIO */
 
-#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0)
-#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0)
+#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0 && (siptr)->si_code != SI_SIGIO)
+#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0 || (siptr)->si_code == SI_SIGIO)
 
 /*
  * SIGILL si_codes
diff -urN linux-2.2.19-pre15/include/asm-ppc/siginfo.h linux/include/asm-ppc/siginfo.h
--- linux-2.2.19-pre15/include/asm-ppc/siginfo.h	Mon Apr 26 15:55:54 1999
+++ linux/include/asm-ppc/siginfo.h	Mon Dec  3 22:16:23 2001
@@ -89,8 +89,8 @@
 #define SI_ASYNCIO	-4	/* sent by AIO completion */
 #define SI_SIGIO	-5	/* sent by queued SIGIO */
 
-#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0)
-#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0)
+#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0 && (siptr)->si_code != SI_SIGIO)
+#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0 || (siptr)->si_code == SI_SIGIO)
 
 /*
  * SIGILL si_codes
diff -urN linux-2.2.19-pre15/include/asm-ppc/uaccess.h linux/include/asm-ppc/uaccess.h
--- linux-2.2.19-pre15/include/asm-ppc/uaccess.h	Sun Dec 10 16:49:44 2000
+++ linux/include/asm-ppc/uaccess.h	Mon Dec  3 22:16:23 2001
@@ -276,8 +276,6 @@
 	return __strnlen_user(str, len, top);
 }
 
-#define strlen_user(str)	strnlen_user((str), 0x7ffffffe)
-
 #endif  /* __ASSEMBLY__ */
 
 #endif	/* _PPC_UACCESS_H */
diff -urN linux-2.2.19-pre15/include/asm-s390/siginfo.h linux/include/asm-s390/siginfo.h
--- linux-2.2.19-pre15/include/asm-s390/siginfo.h	Tue Jan  4 10:12:24 2000
+++ linux/include/asm-s390/siginfo.h	Mon Dec  3 22:16:23 2001
@@ -97,8 +97,8 @@
 #define SI_ASYNCIO	-4	/* sent by AIO completion */
 #define SI_SIGIO	-5	/* sent by queued SIGIO */
 
-#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0)
-#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0)
+#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0 && (siptr)->si_code != SI_SIGIO)
+#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0 || (siptr)->si_code == SI_SIGIO)
 
 /*
  * SIGILL si_codes
diff -urN linux-2.2.19-pre15/include/asm-s390/uaccess.h linux/include/asm-s390/uaccess.h
--- linux-2.2.19-pre15/include/asm-s390/uaccess.h	Sun Dec 10 16:49:44 2000
+++ linux/include/asm-s390/uaccess.h	Mon Dec  3 22:16:23 2001
@@ -505,7 +505,6 @@
 			      : "cc", "0", "4" );
         return n;
 }
-#define strlen_user(str) strnlen_user(str, ~0UL)
 
 /*
  * Zero Userspace
diff -urN linux-2.2.19-pre15/include/asm-sparc/siginfo.h linux/include/asm-sparc/siginfo.h
--- linux-2.2.19-pre15/include/asm-sparc/siginfo.h	Wed Apr 28 14:40:07 1999
+++ linux/include/asm-sparc/siginfo.h	Mon Dec  3 22:16:23 2001
@@ -93,8 +93,8 @@
 #define SI_ASYNCIO	-4	/* sent by AIO completion */
 #define SI_SIGIO	-5	/* sent by queued SIGIO */
 
-#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0)
-#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0)
+#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0 && (siptr)->si_code != SI_SIGIO)
+#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0 || (siptr)->si_code == SI_SIGIO)
 
 /*
  * SIGILL si_codes
diff -urN linux-2.2.19-pre15/include/asm-sparc/uaccess.h linux/include/asm-sparc/uaccess.h
--- linux-2.2.19-pre15/include/asm-sparc/uaccess.h	Tue Oct 26 17:53:42 1999
+++ linux/include/asm-sparc/uaccess.h	Mon Dec  3 22:16:23 2001
@@ -383,16 +383,7 @@
 __sfu_res = __strncpy_from_user((unsigned long) (dest), __sfu_src, __sfu_count); \
 } __sfu_res; })
 
-extern int __strlen_user(const char *);
 extern int __strnlen_user(const char *, long len);
-
-extern __inline__ int strlen_user(const char *str)
-{
-	if(!access_ok(VERIFY_READ, str, 0))
-		return 0;
-	else
-		return __strlen_user(str);
-}
 
 extern __inline__ int strnlen_user(const char *str, long len)
 {
diff -urN linux-2.2.19-pre15/include/asm-sparc64/siginfo.h linux/include/asm-sparc64/siginfo.h
--- linux-2.2.19-pre15/include/asm-sparc64/siginfo.h	Mon Apr 26 15:55:54 1999
+++ linux/include/asm-sparc64/siginfo.h	Mon Dec  3 22:16:23 2001
@@ -152,8 +152,8 @@
 #define SI_ASYNCIO	-4	/* sent by AIO completion */
 #define SI_SIGIO	-5	/* sent by queued SIGIO */
 
-#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0)
-#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0)
+#define SI_FROMUSER(siptr)	((siptr)->si_code <= 0 && (siptr)->si_code != SI_SIGIO)
+#define SI_FROMKERNEL(siptr)	((siptr)->si_code > 0 || (siptr)->si_code == SI_SIGIO)
 
 /*
  * SIGILL si_codes
diff -urN linux-2.2.19-pre15/include/asm-sparc64/uaccess.h linux/include/asm-sparc64/uaccess.h
--- linux-2.2.19-pre15/include/asm-sparc64/uaccess.h	Tue Oct 26 17:53:42 1999
+++ linux/include/asm-sparc64/uaccess.h	Mon Dec  3 22:16:23 2001
@@ -357,10 +357,7 @@
 #define strncpy_from_user(dest,src,count) \
 	__strncpy_from_user((unsigned long)(dest), (unsigned long)(src), (int)(count))
 
-extern int __strlen_user(const char *);
 extern int __strnlen_user(const char *, long len);
-
-#define strlen_user __strlen_user
 #define strnlen_user __strnlen_user
 
 #endif  /* __ASSEMBLY__ */
diff -urN linux-2.2.19-pre15/kernel/signal.c linux/kernel/signal.c
--- linux-2.2.19-pre15/kernel/signal.c	Wed May  3 17:16:53 2000
+++ linux/kernel/signal.c	Mon Dec  3 22:16:23 2001
@@ -820,7 +820,7 @@
 
 	/* Not even root can pretend to send signals from the kernel.
 	   Nor can they impersonate a kill(), which adds source info.  */
-	if (info.si_code >= 0)
+	if (SI_FROMKERNEL(&info))
 		return -EPERM;
 	info.si_signo = sig;
 
diff -urN linux-2.2.19-pre15/kernel/sys.c linux/kernel/sys.c
--- linux-2.2.19-pre15/kernel/sys.c	Sun Dec 10 16:49:44 2000
+++ linux/kernel/sys.c	Mon Dec  3 22:16:23 2001
@@ -381,14 +381,19 @@
 		else
 			return -EPERM;
 	}
+
+	lock_kernel();
+
 	if (euid != (uid_t) -1) {
 		if ((old_ruid == euid) ||
 		    (current->euid == euid) ||
 		    (current->suid == euid) ||
 		    capable(CAP_SETUID))
 			current->fsuid = current->euid = euid;
-		else
+		else {
+			unlock_kernel();
 			return -EPERM;
+		}
 	}
 	if (ruid != (uid_t) -1 ||
 	    (euid != (uid_t) -1 && euid != old_ruid))
@@ -407,6 +412,8 @@
 		current->uid = new_ruid;
 		alloc_uid(current);
 	}
+
+	unlock_kernel();
 	
 	if (!issecure(SECURE_NO_SETUID_FIXUP)) {
 		cap_emulate_setxuid(old_ruid, old_euid, old_suid);
@@ -433,14 +440,18 @@
 	int old_euid = current->euid;
 	int old_ruid, old_suid, new_ruid;
 
+	lock_kernel();
+
 	old_ruid = new_ruid = current->uid;
 	old_suid = current->suid;
 	if (capable(CAP_SETUID))
 		new_ruid = current->euid = current->suid = current->fsuid = uid;
 	else if ((uid == current->uid) || (uid == current->suid))
 		current->fsuid = current->euid = uid;
-	else
+	else {
+		unlock_kernel();
 		return -EPERM;
+	}
 
 	if (current->euid != old_euid)
 		current->dumpable = 0;
@@ -452,6 +463,8 @@
 		alloc_uid(current);
 	}
 
+	unlock_kernel();
+
 	if (!issecure(SECURE_NO_SETUID_FIXUP)) {
 		cap_emulate_setxuid(old_ruid, old_euid, old_suid);
 	}
@@ -481,6 +494,9 @@
 		    (suid != current->euid) && (suid != current->suid))
 			return -EPERM;
 	}
+
+	lock_kernel();
+
 	if (ruid != (uid_t) -1) {
 		/* See above commentary about NPROC rlimit issues here. */
 		free_uid(current);
@@ -496,6 +512,8 @@
 	if (suid != (uid_t) -1)
 		current->suid = suid;
 
+	unlock_kernel();
+
 	if (!issecure(SECURE_NO_SETUID_FIXUP)) {
 		cap_emulate_setxuid(old_ruid, old_euid, old_suid);
 	}
@@ -565,6 +583,8 @@
 {
 	int old_fsuid;
 
+	lock_kernel();
+
 	old_fsuid = current->fsuid;
 	if (uid == current->uid || uid == current->euid ||
 	    uid == current->suid || uid == current->fsuid || 
@@ -572,6 +592,8 @@
 		current->fsuid = uid;
 	if (current->fsuid != old_fsuid)
 		current->dumpable = 0;
+
+	unlock_kernel();
 
 	/* We emulate fsuid by essentially doing a scaled-down version
 	 * of what we did in setresuid and friends. However, we only
