Skip to contentSkip to conversation

Check return value in mm/memory.c

PATCH In review Eugene Teo 3 participants 19 messages Jan 3, 2004 – Jan 9, 2004

Subsystems (5)
lore
Share & tools
lore

Eugene Teo

author
#0 lore raw

PATCH 1/1 Check return value in mm/memory.c

http://www.anomalistic.org/patches/memory-check-ret-find_extend_vma-fix-2.6.1-rc1-mm1.patch

mm/memory.c +5 -0
diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/mm/memory.c 2.6.1-rc1-mm1-fix/mm/memory.c
@@ -34,6 +34,9 @@
  *
  * 16.07.99  -  Support of BIGMEM added by Gerhard Wichert, Siemens AG
  *		([email protected])
+ *
+ * 03.01.04  -	Check the return value of find_extend_vma, added by
+ * 		Eugene Teo ([email protected])
  */
 
 #include <linux/kernel_stat.h>
@@ -712,6 +715,8 @@
 		struct vm_area_struct *	vma;
 
 		vma = find_extend_vma(mm, start);
+		if (unlikely(!vma))
+			return -EFAULT;
 
 #ifdef FIXADDR_USER_START
 		if (!vma &&
Signature · 8 lines
Eugene TEO   <[email protected]>   <http://www.anomalistic.org/>
1024D/14A0DDE5 print D851 4574 E357 469C D308  A01E 7321 A38A 14A0 DDE5
main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); }

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
author
#1 lore raw

PATCH 1/1 Check return value in

http://www.anomalistic.org/patches/mca-check-ret-mca_attach_bus-fix-2.6.1-rc1-mm1.patch

arch/i386/kernel/mca.c +5 -0
diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/arch/i386/kernel/mca.c 2.6.1-rc1-mm1-fix/arch/i386/kernel/mca.c
@@ -35,6 +35,9 @@
  *
  *	Alfred Arnold & David Weinehall August 23rd, 2000
  *	- Added support for Planar POS-registers
+ *
+ *	Eugene Teo January 3rd, 2004
+ *	- Check the return value of mca_attach_bus
  */
 
 #include <linux/module.h>
@@ -270,6 +273,8 @@
 
 	/* All MCA systems have at least a primary bus */
 	bus = mca_attach_bus(MCA_PRIMARY_BUS);
+	if (!bus)
+		goto out_nomem;
 	bus->default_dma_mask = 0xffffffffLL;
 	bus->f.mca_write_pos = mca_pc_write_pos;
 	bus->f.mca_read_pos = mca_pc_read_pos;
Signature · 8 lines
Eugene TEO   <[email protected]>   <http://www.anomalistic.org/>
1024D/14A0DDE5 print D851 4574 E357 469C D308  A01E 7321 A38A 14A0 DDE5
main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); }

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
author
#2 lore raw

PATCH 1/1 Check return value in net/ipv4/ipmr.c

In reply to Eugene Teo

http://www.anomalistic.org/patches/ipmr-check-ret-alloc_netdev-fix-2.6.1-rc1-mm1.patch

net/ipv4/ipmr.c +4 -0
diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/net/ipv4/ipmr.c 2.6.1-rc1-mm1-fix/net/ipv4/ipmr.c
@@ -25,6 +25,7 @@
  *      Carlos Picoto           :       PIMv1 Support
  *	Pavlin Ivanov Radoslavov:	PIMv2 Registers must checksum only PIM header
  *					Relax this requrement to work with older peers.
+ *	Eugene Teo		:	Check the return value of alloc_netdev.		
  *
  */
 
@@ -205,6 +206,9 @@
 	dev = alloc_netdev(sizeof(struct net_device_stats), "pimreg",
 			   reg_vif_setup);
 
+	if (!dev)
+		return NULL;
+
 	if (register_netdevice(dev)) {
 		kfree(dev);
 		return NULL;
Signature · 8 lines
Eugene TEO   <[email protected]>   <http://www.anomalistic.org/>
1024D/14A0DDE5 print D851 4574 E357 469C D308  A01E 7321 A38A 14A0 DDE5
main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); }

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
author
#3 lore raw

PATCH 1/1 Check return value in fs/cifs/file.c

In reply to Eugene Teo

http://www.anomalistic.org/patches/cifs-check-ret-d_alloc-fix-2.6.1-rc1-mm1.patch

fs/cifs/file.c +4 -0
diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/fs/cifs/file.c 2.6.1-rc1-mm1-fix/fs/cifs/file.c
@@ -1250,6 +1250,10 @@
 		}
 	} else {
 		tmp_dentry = d_alloc(file->f_dentry, qstring);
+		if (!tmp_dentry) {
+			cERROR(1,("could not allocate a dcache entry"));
+			return;
+		}
 		*ptmp_inode = new_inode(file->f_dentry->d_sb);
 		tmp_dentry->d_op = &cifs_dentry_ops;
 		cFYI(0, (" instantiate dentry 0x%p with inode 0x%p ",
Signature · 8 lines
Eugene TEO   <[email protected]>   <http://www.anomalistic.org/>
1024D/14A0DDE5 print D851 4574 E357 469C D308  A01E 7321 A38A 14A0 DDE5
main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); }

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
#4 lore raw
In reply to Eugene Teo
Quoted 16 lines · Eugene Teo

http://www.anomalistic.org/patches/memory-check-ret-find_extend_vma-fix-2.6.1-rc1-mm1.patch

diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/mm/memory.c 2.6.1-rc1-mm1-fix/mm/memory.c

mm/memory.c +3 -0
@@ -34,6 +34,9 @@
  *
  * 16.07.99  -  Support of BIGMEM added by Gerhard Wichert, Siemens AG
  *		([email protected])
+ *
+ * 03.01.04  -	Check the return value of find_extend_vma, added by
+ * 		Eugene Teo ([email protected])
  */
 
 #include <linux/kernel_stat.h>

mm/memory.c line 719

Quoted 5 lines
mm/memory.c +2 -0
@@ -712,6 +715,8 @@
 		struct vm_area_struct *	vma;
 
 		vma = find_extend_vma(mm, start);
+		if (unlikely(!vma))
+			return -EFAULT;

But we already check the return value ...

                vma = find_extend_vma(mm, start);
#ifdef FIXADDR_USER_START
                if (!vma &&
                    start >= FIXADDR_USER_START && start < FIXADDR_USER_END) {

...
#endif

                if (!vma || (pages && (vma->vm_flags & VM_IO))
                                || !(flags & vma->vm_flags))
                        return i ? : -EFAULT;
Signature · 10 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
#5 lore raw

Re: [Kernel-janitors] [PATCH] Check return value in

In reply to Eugene Teo
Quoted 16 lines · Eugene Teo

http://www.anomalistic.org/patches/mca-check-ret-mca_attach_bus-fix-2.6.1-rc1-mm1.patch

diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/arch/i386/kernel/mca.c 2.6.1-rc1-mm1-fix/arch/i386/kernel/mca.c

arch/i386/kernel/mca.c +3 -0
@@ -35,6 +35,9 @@
  *
  *	Alfred Arnold & David Weinehall August 23rd, 2000
  *	- Added support for Planar POS-registers
+ *
+ *	Eugene Teo January 3rd, 2004
+ *	- Check the return value of mca_attach_bus
  */
 
 #include <linux/module.h>

arch/i386/kernel/mca.c line 280

Quoted 8 lines
arch/i386/kernel/mca.c +2 -0
@@ -270,6 +273,8 @@
 
 	/* All MCA systems have at least a primary bus */
 	bus = mca_attach_bus(MCA_PRIMARY_BUS);
+	if (!bus)
+		goto out_nomem;
 	bus->default_dma_mask = 0xffffffffLL;
 	bus->f.mca_write_pos = mca_pc_write_pos;
 	bus->f.mca_read_pos = mca_pc_read_pos;

This one looks right, but I don't think you should add your name to the file. Two lines is not significant for copyright purposes.

Signature · 10 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
#6 lore raw

Re: [Kernel-janitors] [PATCH] Check return value in net/ipv4/ipmr.c

In reply to Eugene Teo
Quoted 14 lines · Eugene Teo

http://www.anomalistic.org/patches/ipmr-check-ret-alloc_netdev-fix-2.6.1-rc1-mm1.patch

diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/net/ipv4/ipmr.c 2.6.1-rc1-mm1-fix/net/ipv4/ipmr.c

net/ipv4/ipmr.c +1 -0
@@ -25,6 +25,7 @@
  *      Carlos Picoto           :       PIMv1 Support
  *	Pavlin Ivanov Radoslavov:	PIMv2 Registers must checksum only PIM header
  *					Relax this requrement to work with older peers.
+ *	Eugene Teo		:	Check the return value of alloc_netdev.		
  *
  */
 

net/ipv4/ipmr.c line 214

Quoted 9 lines
net/ipv4/ipmr.c +3 -0
@@ -205,6 +206,9 @@
 	dev = alloc_netdev(sizeof(struct net_device_stats), "pimreg",
 			   reg_vif_setup);
 
+	if (!dev)
+		return NULL;
+
 	if (register_netdevice(dev)) {
 		kfree(dev);
 		return NULL;

Looks good, but I'd hold off on network drivers till viro's alloc_netdev() 150-patches have gone in.

Again, adding your name to the file isn't really necessary.

Signature · 10 lines
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
author
#7 lore raw

Re: [Kernel-janitors] [PATCH] Check return value in

In reply to Eugene Teo

Yes, correct. Insignificant. New patch compiles, and tested.

http://www.anomalistic.org/patches/mca-check-ret-mca_attach_bus-fix-2.6.1-rc1-mm1.patch

arch/i386/kernel/mca.c +2 -0
diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/arch/i386/kernel/mca.c 2.6.1-rc1-mm1-fix/arch/i386/kernel/mca.c
@@ -270,6 +270,8 @@
 
 	/* All MCA systems have at least a primary bus */
 	bus = mca_attach_bus(MCA_PRIMARY_BUS);
+	if (!bus)
+		goto out_nomem;
 	bus->default_dma_mask = 0xffffffffLL;
 	bus->f.mca_write_pos = mca_pc_write_pos;
 	bus->f.mca_read_pos = mca_pc_read_pos;

<quote sender="Matthew Wilcox">

Quoted 7 lines · Eugene Teo
Quoted 6 lines

http://www.anomalistic.org/patches/mca-check-ret-mca_attach_bus-fix-2.6.1-rc1-mm1.patch

diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/arch/i386/kernel/mca.c 2.6.1-rc1-mm1-fix/arch/i386/kernel/mca.c

arch/i386/kernel/mca.c +0 -0
@@ -35,6 +35,9 @@

[snip]

Quoted 2 lines

This one looks right, but I don't think you should add your name to the file. Two lines is not significant for copyright purposes.

Signature · 8 lines
Eugene TEO   <[email protected]>   <http://www.anomalistic.org/>
1024D/14A0DDE5 print D851 4574 E357 469C D308  A01E 7321 A38A 14A0 DDE5
main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); }

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
author
#8 lore raw

Re: [Kernel-janitors] [PATCH] Check return value in net/ipv4/ipmr.c

In reply to Eugene Teo

<quote sender="Matthew Wilcox">

Quoted 3 lines · Eugene Teo
Quoted 2 lines

http://www.anomalistic.org/patches/ipmr-check-ret-alloc_netdev-fix-2.6.1-rc1-mm1.patch

[snip]

Quoted 4 lines

Looks good, but I'd hold off on network drivers till viro's alloc_netdev() 150-patches have gone in.

Again, adding your name to the file isn't really necessary.

ok! but just for completeness...

http://www.anomalistic.org/patches/ipmr-check-ret-alloc_netdev-fix-2.6.1-rc1-mm1.patch

net/ipv4/ipmr.c +3 -0
diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/net/ipv4/ipmr.c 2.6.1-rc1-mm1-fix/net/ipv4/ipmr.c
@@ -205,6 +205,9 @@
 	dev = alloc_netdev(sizeof(struct net_device_stats), "pimreg",
 			   reg_vif_setup);
 
+	if (!dev)
+		return NULL;
+
 	if (register_netdevice(dev)) {
 		kfree(dev);
 		return NULL;
Signature · 8 lines
Eugene TEO   <[email protected]>   <http://www.anomalistic.org/>
1024D/14A0DDE5 print D851 4574 E357 469C D308  A01E 7321 A38A 14A0 DDE5
main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); }

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
author
#9 lore raw
In reply to Eugene Teo

<quote sender="Matthew Wilcox">

Quoted 30 lines · Eugene Teo
Quoted 16 lines

http://www.anomalistic.org/patches/memory-check-ret-find_extend_vma-fix-2.6.1-rc1-mm1.patch

diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/mm/memory.c 2.6.1-rc1-mm1-fix/mm/memory.c

mm/memory.c +3 -0
@@ -34,6 +34,9 @@
  *
  * 16.07.99  -  Support of BIGMEM added by Gerhard Wichert, Siemens AG
  *		([email protected])
+ *
+ * 03.01.04  -	Check the return value of find_extend_vma, added by
+ * 		Eugene Teo ([email protected])
  */
 
 #include <linux/kernel_stat.h>

mm/memory.c line 719

Quoted 5 lines
mm/memory.c +2 -0
@@ -712,6 +715,8 @@
 		struct vm_area_struct *	vma;
 
 		vma = find_extend_vma(mm, start);
+		if (unlikely(!vma))
+			return -EFAULT;

But we already check the return value ...

                vma = find_extend_vma(mm, start);
#ifdef FIXADDR_USER_START
                if (!vma &&
                    start >= FIXADDR_USER_START && start < FIXADDR_USER_END) {
Quoted 6 lines

...
#endif

                if (!vma || (pages && (vma->vm_flags & VM_IO))
                                || !(flags & vma->vm_flags))
                        return i ? : -EFAULT;

Whoops. Thanks Matthew.

Signature · 8 lines
Eugene TEO   <[email protected]>   <http://www.anomalistic.org/>
1024D/14A0DDE5 print D851 4574 E357 469C D308  A01E 7321 A38A 14A0 DDE5
main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); }

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
author
#10 lore raw

PATCH 1/1 Check return value in

In reply to Eugene Teo

Patch compiles, and tested. Please apply.

http://www.anomalistic.org/patches/apm-check-ret-kernel_thread-fix-2.6.1-rc1-mm1.patch

arch/i386/kernel/apm.c +6 -1
diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/arch/i386/kernel/apm.c 2.6.1-rc1-mm1-fix/arch/i386/kernel/apm.c
@@ -1891,6 +1891,7 @@
 static int __init apm_init(void)
 {
 	struct proc_dir_entry *apm_proc;
+	int ret;
 	int i;
 
 	if (apm_info.bios.version = 0) {
@@ -2008,7 +2009,11 @@
 	if (apm_proc)
 		apm_proc->owner = THIS_MODULE;
 
-	kernel_thread(apm, NULL, CLONE_KERNEL | SIGCHLD);
+	ret = kernel_thread(apm, NULL, CLONE_KERNEL | SIGCHLD);
+	if (ret < 0) {
+		printk(KERN_ERR "apm: disabled - Unable to start kernel thread.\n");
+		return -ENODEV;
+	}
 
 	if (num_online_cpus() > 1 && !smp ) {
 		printk(KERN_NOTICE
Signature · 8 lines
Eugene TEO   <[email protected]>   <http://www.anomalistic.org/>
1024D/14A0DDE5 print D851 4574 E357 469C D308  A01E 7321 A38A 14A0 DDE5
main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); }

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
author
#11 lore raw

PATCH 1/1 Check return value in

In reply to Eugene Teo

Patch compiles, and tested. Please apply.

http://www.anomalistic.org/patches/i387-check-ret-__copy_from_user-fix-2.6.1-rc1-mm1.patch

arch/i386/kernel/i387.c +3 -2
diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/arch/i386/kernel/i387.c 2.6.1-rc1-mm1-fix/arch/i386/kernel/i387.c
@@ -456,8 +456,9 @@
 int set_fpxregs( struct task_struct *tsk, struct user_fxsr_struct __user *buf )
 {
 	if ( cpu_has_fxsr ) {
-		__copy_from_user( &tsk->thread.i387.fxsave, buf,
-				  sizeof(struct user_fxsr_struct) );
+		if (__copy_from_user( &tsk->thread.i387.fxsave, buf,
+				  sizeof(struct user_fxsr_struct) ))
+			return -EFAULT;
 		/* mxcsr bit 6 and 31-16 must be zero for security reasons */
 		tsk->thread.i387.fxsave.mxcsr &= 0xffbf;
 		return 0;
Signature · 8 lines
Eugene TEO   <[email protected]>   <http://www.anomalistic.org/>
1024D/14A0DDE5 print D851 4574 E357 469C D308  A01E 7321 A38A 14A0 DDE5
main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); }

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
author
#12 lore raw

PATCH 1/1 Check return value of __copy_from_user

In reply to Eugene Teo

Patch compiles, and tested. Please apply.

http://www.anomalistic.org/patches/fpu_entry-check-ret-__copy_to_user-fix-2.6.1-rc1-mm1.patch

arch/i386/math-emu/fpu_entry.c +2 -1
diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/arch/i386/math-emu/fpu_entry.c 2.6.1-rc1-mm1-fix/arch/i386/math-emu/fpu_entry.c
@@ -686,7 +686,8 @@
 
   RE_ENTRANT_CHECK_OFF;
   FPU_verify_area(VERIFY_READ, d, 7*4 + 8*10);
-  __copy_from_user(&S387->cwd, d, 7*4);
+  if (__copy_from_user(&S387->cwd, d, 7*4))
+    return -1;
   RE_ENTRANT_CHECK_ON;
 
   d += 7*4;
Signature · 8 lines
Eugene TEO   <[email protected]>   <http://www.anomalistic.org/>
1024D/14A0DDE5 print D851 4574 E357 469C D308  A01E 7321 A38A 14A0 DDE5
main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); }

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
author
#13 lore raw

PATCH 1/1 Check return value of kernel_thread

In reply to Eugene Teo

Patch compiles, and tested. Please apply.

http://www.anomalistic.org/patches/main-check-ret-kernel_thread-fix-2.6.1-rc1-mm1.patch

init/main.c +3 -1
diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/init/main.c 2.6.1-rc1-mm1-fix/init/main.c
@@ -373,7 +373,9 @@
 
 static void rest_init(void)
 {
-	kernel_thread(init, NULL, CLONE_FS | CLONE_SIGHAND);
+	int ret = kernel_thread(init, NULL, CLONE_FS | CLONE_SIGHAND);
+	if (ret < 0)
+		panic("Unable to start init thread\n");
 	unlock_kernel();
  	cpu_idle();
 } 
Signature · 8 lines
Eugene TEO   <[email protected]>   <http://www.anomalistic.org/>
1024D/14A0DDE5 print D851 4574 E357 469C D308  A01E 7321 A38A 14A0 DDE5
main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); }

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
#14 lore raw

Re: [Kernel-janitors] [PATCH] Check return value in

In reply to Eugene Teo

On Sat, 3 Jan 2004 22:35:09 +0000 Matthew Wilcox <[email protected]> wrote:

| On Sat, Jan 03, 2004 at 09:30:27PM +0800, Eugene Teo wrote:
| > http://www.anomalistic.org/patches/mca-check-ret-mca_attach_bus-fix-2.6.1-rc1-mm1.patch
| > 
| > diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/arch/i386/kernel/mca.c 2.6.1-rc1-mm1-fix/arch/i386/kernel/mca.c
| > --- 2.6.1-rc1-mm1/arch/i386/kernel/mca.c	2003-12-18 10:59:16.000000000 +0800
| > +++ 2.6.1-rc1-mm1-fix/arch/i386/kernel/mca.c	2004-01-03 20:47:04.000000000 +0800
| > @@ -35,6 +35,9 @@
| >   *
| >   *	Alfred Arnold & David Weinehall August 23rd, 2000
| >   *	- Added support for Planar POS-registers
| > + *
| > + *	Eugene Teo January 3rd, 2004
| > + *	- Check the return value of mca_attach_bus
| >   */
| >  
| >  #include <linux/module.h>
| > @@ -270,6 +273,8 @@
| >  
| >  	/* All MCA systems have at least a primary bus */
| >  	bus = mca_attach_bus(MCA_PRIMARY_BUS);
| > +	if (!bus)
| > +		goto out_nomem;
| >  	bus->default_dma_mask = 0xffffffffLL;
| >  	bus->f.mca_write_pos = mca_pc_write_pos;
| >  	bus->f.mca_read_pos = mca_pc_read_pos;
| 
| This one looks right, but I don't think you should add your name to
| the file.  Two lines is not significant for copyright purposes.

The source file changelog also isn't needed since we haven't a decent (better) version control system now.

--
~Randy
MOTD: Always include version info.

--
~Randy
MOTD: Always include version info.
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

author
#15 lore raw

Re: [Kernel-janitors] [PATCH] Check return value in

In reply to Eugene Teo

<quote sender="Randy.Dunlap">

Quoted 1 line · On Sat, 3 Jan 2004 22:35:09 +0000 Matthew Wilcox <[email protected]> wrote:

[snip]

Quoted 2 lines

The source file changelog also isn't needed since we haven't a decent (better) version control system now.

roger. please see the resubmission patch. thanks.

Eugene

Quoted 9 lines

--
~Randy
MOTD: Always include version info.

--
~Randy
MOTD: Always include version info.

Signature · 8 lines
Eugene TEO   <[email protected]>   <http://www.anomalistic.org/>
1024D/14A0DDE5 print D851 4574 E357 469C D308  A01E 7321 A38A 14A0 DDE5
main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); }

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
#16 lore raw

Re: [Kernel-janitors] [PATCH] Check return value of __copy_from_user

In reply to Eugene Teo

On Sun, 4 Jan 2004 16:25:50 +0800 Eugene Teo <[email protected]> wrote:

| Patch compiles, and tested. Please apply.
| 
| http://www.anomalistic.org/patches/fpu_entry-check-ret-__copy_to_user-fix-2.6.1-rc1-mm1.patch
| 
| diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/arch/i386/math-emu/fpu_entry.c 2.6.1-rc1-mm1-fix/arch/i386/math-emu/fpu_entry.c
| --- 2.6.1-rc1-mm1/arch/i386/math-emu/fpu_entry.c	2004-01-04 16:22:38.000000000 +0800
| +++ 2.6.1-rc1-mm1-fix/arch/i386/math-emu/fpu_entry.c	2004-01-04 16:09:20.000000000 +0800
| @@ -686,7 +686,8 @@
|  
|    RE_ENTRANT_CHECK_OFF;
|    FPU_verify_area(VERIFY_READ, d, 7*4 + 8*10);
| -  __copy_from_user(&S387->cwd, d, 7*4);
| +  if (__copy_from_user(&S387->cwd, d, 7*4))
| +    return -1;
|    RE_ENTRANT_CHECK_ON;
|  
|    d += 7*4;

This one is confusing to me. I don't see where/why the patch is needed since the BK sources already have this if() test and return. Did -mm patches unfix this somehow?
I'm not planning to look thru the -mm patches to see what happened here.

--
~Randy
MOTD: Always include version info.
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

author
#17 lore raw

Re: [Kernel-janitors] [PATCH] Check return value of __copy_from_user

In reply to Eugene Teo

<quote sender="Randy.Dunlap">

Quoted 20 lines · On Sun, 4 Jan 2004 16:25:50 +0800 Eugene Teo <[email protected]> wrote:
| Patch compiles, and tested. Please apply.
| 
| http://www.anomalistic.org/patches/fpu_entry-check-ret-__copy_to_user-fix-2.6.1-rc1-mm1.patch
| 
| diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/arch/i386/math-emu/fpu_entry.c 2.6.1-rc1-mm1-fix/arch/i386/math-emu/fpu_entry.c
| --- 2.6.1-rc1-mm1/arch/i386/math-emu/fpu_entry.c	2004-01-04 16:22:38.000000000 +0800
| +++ 2.6.1-rc1-mm1-fix/arch/i386/math-emu/fpu_entry.c	2004-01-04 16:09:20.000000000 +0800
| @@ -686,7 +686,8 @@
|  
|    RE_ENTRANT_CHECK_OFF;
|    FPU_verify_area(VERIFY_READ, d, 7*4 + 8*10);
| -  __copy_from_user(&S387->cwd, d, 7*4);
| +  if (__copy_from_user(&S387->cwd, d, 7*4))
| +    return -1;
|    RE_ENTRANT_CHECK_ON;
|  
|    d += 7*4;
Quoted 4 lines

This one is confusing to me. I don't see where/why the patch is needed since the BK sources already have this if() test and return. Did -mm patches unfix this somehow?
I'm not planning to look thru the -mm patches to see what happened here.

I will look at it, and get back to you.

Quoted 5 lines

--
~Randy
MOTD: Always include version info.

Signature · 8 lines
Eugene TEO   <[email protected]>   <http://www.anomalistic.org/>
1024D/14A0DDE5 print D851 4574 E357 469C D308  A01E 7321 A38A 14A0 DDE5
main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); }

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
author
#18 lore raw

Re: [Kernel-janitors] [PATCH] Check return value of __copy_from_user

In reply to Eugene Teo

<quote sender="Eugene Teo">

Quoted 25 lines

<quote sender="Randy.Dunlap">

Quoted 24 lines · On Sun, 4 Jan 2004 16:25:50 +0800 Eugene Teo <[email protected]> wrote:
| Patch compiles, and tested. Please apply.
| 
| http://www.anomalistic.org/patches/fpu_entry-check-ret-__copy_to_user-fix-2.6.1-rc1-mm1.patch
| 
| diff -Naur -X /home/amnesia/w/dontdiff 2.6.1-rc1-mm1/arch/i386/math-emu/fpu_entry.c 2.6.1-rc1-mm1-fix/arch/i386/math-emu/fpu_entry.c
| --- 2.6.1-rc1-mm1/arch/i386/math-emu/fpu_entry.c	2004-01-04 16:22:38.000000000 +0800
| +++ 2.6.1-rc1-mm1-fix/arch/i386/math-emu/fpu_entry.c	2004-01-04 16:09:20.000000000 +0800
| @@ -686,7 +686,8 @@
|  
|    RE_ENTRANT_CHECK_OFF;
|    FPU_verify_area(VERIFY_READ, d, 7*4 + 8*10);
| -  __copy_from_user(&S387->cwd, d, 7*4);
| +  if (__copy_from_user(&S387->cwd, d, 7*4))
| +    return -1;
|    RE_ENTRANT_CHECK_ON;
|  
|    d += 7*4;

This one is confusing to me. I don't see where/why the patch is needed since the BK sources already have this if() test and return. Did -mm patches unfix this somehow?
I'm not planning to look thru the -mm patches to see what happened here.

Ok, I am confused too. I downloaded a fresh copy of 2.6.0, .1-rc1, and .1-rc1-mm1, and there is this test already, whereas my original is also a fresh copy of 2.6.0, .1-rc1, and .1-rc1-mm1. I couldn't have removed the tests, and then write the tests again :) Kindly ignore this patch.

Signature · 8 lines
Eugene TEO   <[email protected]>   <http://www.anomalistic.org/>
1024D/14A0DDE5 print D851 4574 E357 469C D308  A01E 7321 A38A 14A0 DDE5
main(i) { putchar(182623909 >> (i-1) * 5&31|!!(i<7)<<6) && main(++i); }

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors