patch-2.1.10 linux/net/bridge/br.c

Next file: linux/net/core/datagram.c
Previous file: linux/net/appletalk/ddp.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.9/linux/net/bridge/br.c linux/net/bridge/br.c
@@ -1442,22 +1442,20 @@
 	switch(cmd)
 	{
 		case SIOCGIFBR:	/* get bridging control blocks */
-			err = verify_area(VERIFY_WRITE, arg, 
-				sizeof(struct br_stat));
-			if(err)
-				return err;
 			memcpy(&br_stats.bridge_data, &bridge_info, sizeof(Bridge_data));
 			memcpy(&br_stats.port_data, &port_info, sizeof(Port_data)*No_of_ports);
-			copy_to_user(arg, &br_stats, sizeof(struct br_stat));
-			return(0);
+			err = copy_to_user(arg, &br_stats, sizeof(struct br_stat));
+			if (err)
+			{
+				err = -EFAULT;
+			}
+			return err;
 		case SIOCSIFBR:
 			if (!suser())
 				return -EPERM;
-			err = verify_area(VERIFY_READ, arg, 
-				sizeof(struct br_cf));
-			if(err)
-				return err;
-			copy_from_user(&bcf, arg, sizeof(struct br_cf));
+			err = copy_from_user(&bcf, arg, sizeof(struct br_cf));
+			if (err)
+				return -EFAULT; 
 			switch (bcf.cmd) {
 				case BRCMD_BRIDGE_ENABLE:
 					if (br_stats.flags & BR_UP)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov