From: Yang Hongyang <yanghy@cn•fujitsu.com>
To: yoshfuji@linux-ipv6•org
Cc: netdev@vger•kernel.org, FNST-Wei Yongjun <yjwei@cn•fujitsu.com>,
Wang Chen <wangchen@cn•fujitsu.com>,
davem@sunset•davemloft.net
Subject: [PATCH] IPv6: Fix the data length of get destination options with short length
Date: Wed, 28 May 2008 14:49:20 +0800 [thread overview]
Message-ID: <483D0070.2090909@cn.fujitsu.com> (raw)
If get destination options with length which is not enough for that
option,getsockopt() will still return the real length of the option,
which is larger then the buffer space.
This is because ipv6_getsockopt_sticky() returns the real length of
the option.
This patch fix this problem.
Signed-off-by: Yang Hongyang <yanghy@cn•fujitsu.com>
--- net/ipv6/ipv6_sockglue.c 2008-05-28 09:17:14.000000000 +0800
+++ net/ipv6/ipv6_sockglue.c 2008-05-28 12:41:01.000000000 +0800
@@ -832,7 +832,7 @@ static int ipv6_getsockopt_sticky(struct
len = min_t(unsigned int, len, ipv6_optlen(hdr));
if (copy_to_user(optval, hdr, len))
return -EFAULT;
- return ipv6_optlen(hdr);
+ return len;
}
---------
2.6.26-rc4
next reply other threads:[~2008-05-28 6:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-28 6:49 Yang Hongyang [this message]
2008-05-28 6:54 ` [PATCH] IPv6: Fix the data length of get destination options with short length Wang Chen
2008-05-28 7:06 ` Yang Hongyang
2008-05-28 11:13 ` YOSHIFUJI Hideaki / 吉藤英明
2008-05-29 1:29 ` Yang Hongyang
2008-05-29 2:29 ` Yang Hongyang
2008-05-29 8:42 ` YOSHIFUJI Hideaki / 吉藤英明
-- strict thread matches above, loose matches on Subject: below --
2008-05-28 7:15 Yang Hongyang
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=483D0070.2090909@cn.fujitsu.com \
--to=yanghy@cn$(echo .)fujitsu.com \
--cc=davem@sunset$(echo .)davemloft.net \
--cc=netdev@vger$(echo .)kernel.org \
--cc=wangchen@cn$(echo .)fujitsu.com \
--cc=yjwei@cn$(echo .)fujitsu.com \
--cc=yoshfuji@linux-ipv6$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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