DO NOT MERGE : THIS GERRIT IS TO ENABLE KW ON /kernel/net/x25

Change-Id: Ifb6f0faf57405bf13ebae7e1e5d3e68ffab5aa64
Signed-off-by: Sachin Sharma <sachin084@codeaurora.org>
This commit is contained in:
Sachin Sharma
2014-02-18 00:16:23 -08:00
parent 2ed8c92f9d
commit 20d658edf5
3 changed files with 31 additions and 7 deletions
Regular → Executable
+13 -2
View File
@@ -59,7 +59,9 @@
#include <net/x25.h>
#include <net/compat.h>
#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;
Regular → Executable
+9 -2
View File
@@ -31,6 +31,9 @@
#include <linux/init.h>
#include <net/x25.h>
#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;
Regular → Executable
+9 -3
View File
@@ -21,7 +21,9 @@
#include <linux/init.h>
#include <linux/slab.h>
#include <net/x25.h>
#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;