diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c old mode 100644 new mode 100755 index a306bc66000..c14304674b8 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -59,7 +59,9 @@ #include #include - +#ifdef KW_TAINT_ANALYSIS + extern void * get_tainted_stuff(); +#endif int sysctl_x25_restart_request_timeout = X25_DEFAULT_T20; int sysctl_x25_call_request_timeout = X25_DEFAULT_T21; int sysctl_x25_reset_request_timeout = X25_DEFAULT_T22; @@ -1625,7 +1627,7 @@ static const struct net_proto_family x25_family_ops = { #ifdef CONFIG_COMPAT static int compat_x25_subscr_ioctl(unsigned int cmd, - struct compat_x25_subscrip_struct __user *x25_subscr32) + struct compat_x25_subscrip_struct __user *x25_subscr32_actual) { struct compat_x25_subscrip_struct x25_subscr; struct x25_neigh *nb; @@ -1633,6 +1635,11 @@ static int compat_x25_subscr_ioctl(unsigned int cmd, int rc = -EINVAL; rc = -EFAULT; + #ifdef KW_TAINT_ANALYSIS + struct compat_x25_subscrip_struct __user *x25_subscr32 = (struct compat_x25_subscrip_struct __user *)get_tainted_stuff(); + #else + struct compat_x25_subscrip_struct __user *x25_subscr32 = x25_subscr32_actual; + #endif if (copy_from_user(&x25_subscr, x25_subscr32, sizeof(*x25_subscr32))) goto out; @@ -1675,7 +1682,11 @@ out_dev_put: static int compat_x25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) { + #ifdef KW_TAINT_ANALYSIS + void __user *argp = (void __user *)get_tainted_stuff(); + #else void __user *argp = compat_ptr(arg); + #endif struct sock *sk = sock->sk; int rc = -ENOIOCTLCMD; diff --git a/net/x25/x25_link.c b/net/x25/x25_link.c old mode 100644 new mode 100755 index 4acacf3c661..c82fcc26416 --- a/net/x25/x25_link.c +++ b/net/x25/x25_link.c @@ -31,6 +31,9 @@ #include #include +#ifdef KW_TAINT_ANALYSIS + extern void * get_tainted_stuff(); +#endif LIST_HEAD(x25_neigh_list); DEFINE_RWLOCK(x25_neigh_list_lock); @@ -338,13 +341,17 @@ struct x25_neigh *x25_get_neigh(struct net_device *dev) /* * Handle the ioctls that control the subscription functions. */ -int x25_subscr_ioctl(unsigned int cmd, void __user *arg) +int x25_subscr_ioctl(unsigned int cmd, void __user *arg_actual) { struct x25_subscrip_struct x25_subscr; struct x25_neigh *nb; struct net_device *dev; int rc = -EINVAL; - + #ifdef KW_TAINT_ANALYSIS + void __user *arg = (void __user *)get_tainted_stuff(); + #else + void __user *arg = arg_actual; + #endif if (cmd != SIOCX25GSUBSCRIP && cmd != SIOCX25SSUBSCRIP) goto out; diff --git a/net/x25/x25_route.c b/net/x25/x25_route.c old mode 100644 new mode 100755 index cf636627005..7a1778a4118 --- a/net/x25/x25_route.c +++ b/net/x25/x25_route.c @@ -21,7 +21,9 @@ #include #include #include - +#ifdef KW_TAINT_ANALYSIS + extern void * get_tainted_stuff(); +#endif LIST_HEAD(x25_route_list); DEFINE_RWLOCK(x25_route_list_lock); @@ -179,12 +181,16 @@ struct x25_route *x25_get_route(struct x25_address *addr) /* * Handle the ioctls that control the routing functions. */ -int x25_route_ioctl(unsigned int cmd, void __user *arg) +int x25_route_ioctl(unsigned int cmd, void __user *arg_actual) { struct x25_route_struct rt; struct net_device *dev; int rc = -EINVAL; - + #ifdef KW_TAINT_ANALYSIS + void __user *arg = (void __user *)get_tainted_stuff(); + #else + void __user *arg = arg_actual; + #endif if (cmd != SIOCADDRT && cmd != SIOCDELRT) goto out;