From: Joe Perches <joe@perches.com>
To: David Miller <davem@davemloft.net>
Cc: eric.dumazet@gmail.com, netdev@vger.kernel.org
Subject: [PATCH] ip6mr: Add sizeof verification to MRT6_ASSERT and MT6_PIM
Date: Sun, 25 Nov 2012 20:26:34 -0800 [thread overview]
Message-ID: <1353903994.2493.2.camel@joe-AO722> (raw)
In-Reply-To: <20121125.164036.1283541826012498001.davem@davemloft.net>
Verify the length of the user-space arguments.
Signed-off-by: Joe Perches <joe@perches.com>
---
net/ipv6/ip6mr.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 79bb490..926ea54 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1646,6 +1646,9 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, uns
case MRT6_ASSERT:
{
int v;
+
+ if (optlen != sizeof(v))
+ return -EINVAL;
if (get_user(v, (int __user *)optval))
return -EFAULT;
mrt->mroute_do_assert = v;
@@ -1656,6 +1659,9 @@ int ip6_mroute_setsockopt(struct sock *sk, int optname, char __user *optval, uns
case MRT6_PIM:
{
int v;
+
+ if (optlen != sizeof(v))
+ return -EINVAL;
if (get_user(v, (int __user *)optval))
return -EFAULT;
v = !!v;
next prev parent reply other threads:[~2012-11-26 4:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-25 16:41 [PATCH net-next] ipv4: ipmr: various fixes and cleanups Eric Dumazet
2012-11-25 18:27 ` Joe Perches
2012-11-25 19:13 ` Eric Dumazet
2012-11-25 19:35 ` [PATCH] ipv4/ipmr and ipv6/ip6mr: Convert int mroute_do_<foo> to bool Joe Perches
2012-11-25 21:40 ` David Miller
2012-11-26 4:26 ` Joe Perches [this message]
2012-11-26 22:36 ` [PATCH] ip6mr: Add sizeof verification to MRT6_ASSERT and MT6_PIM David Miller
2012-11-25 21:40 ` [PATCH net-next] ipv4: ipmr: various fixes and cleanups David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1353903994.2493.2.camel@joe-AO722 \
--to=joe@perches.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).