[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1330593390-19233-1-git-send-email-santoshprasadnayak@gmail.com>
Date: Thu, 1 Mar 2012 14:46:30 +0530
From: santosh nayak <santoshprasadnayak@...il.com>
To: bart.de.schuymer@...dora.be
Cc: pablo@...filter.org, kaber@...sh.net, shemminger@...tta.com,
davem@...emloft.net, netfilter-devel@...r.kernel.org,
netfilter@...r.kernel.org, coreteam@...filter.org,
bridge@...ts.linux-foundation.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Santosh Nayak <santoshprasadnayak@...il.com>
Subject: [PATCH 1/3] netfilter: Fix copy_to_user too small size parametre.
From: Santosh Nayak <santoshprasadnayak@...il.com>
While copying to userspace, the size of source is 29byte where as
size parametre is 32 byte. Its leaking extra-information from
kernel space to user space.
Replace EBT_FUNCTION_MAXNAMELEN by XT_EXTENSION_MAXNAMELEN.
Signed-off-by: Santosh Nayak <santoshprasadnayak@...il.com>
---
net/bridge/netfilter/ebtables.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
index 5864cc4..f3fcbd9 100644
--- a/net/bridge/netfilter/ebtables.c
+++ b/net/bridge/netfilter/ebtables.c
@@ -1335,7 +1335,7 @@ static inline int ebt_make_matchname(const struct ebt_entry_match *m,
const char *base, char __user *ubase)
{
char __user *hlp = ubase + ((char *)m - base);
- if (copy_to_user(hlp, m->u.match->name, EBT_FUNCTION_MAXNAMELEN))
+ if (copy_to_user(hlp, m->u.match->name, XT_EXTENSION_MAXNAMELEN))
return -EFAULT;
return 0;
}
@@ -1344,7 +1344,7 @@ static inline int ebt_make_watchername(const struct ebt_entry_watcher *w,
const char *base, char __user *ubase)
{
char __user *hlp = ubase + ((char *)w - base);
- if (copy_to_user(hlp , w->u.watcher->name, EBT_FUNCTION_MAXNAMELEN))
+ if (copy_to_user(hlp , w->u.watcher->name, XT_EXTENSION_MAXNAMELEN))
return -EFAULT;
return 0;
}
@@ -1368,7 +1368,7 @@ ebt_make_names(struct ebt_entry *e, const char *base, char __user *ubase)
ret = EBT_WATCHER_ITERATE(e, ebt_make_watchername, base, ubase);
if (ret != 0)
return ret;
- if (copy_to_user(hlp, t->u.target->name, EBT_FUNCTION_MAXNAMELEN))
+ if (copy_to_user(hlp, t->u.target->name, XT_EXTENSION_MAXNAMELEN))
return -EFAULT;
return 0;
}
--
1.7.4.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists