netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang Chen <wangchen@cn.fujitsu.com>
To: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [2.6 PATCH] IPV6: Check length of optval provided by user in setsockopt()
Date: Mon, 31 Mar 2008 19:04:54 +0800	[thread overview]
Message-ID: <47F0C556.8090109@cn.fujitsu.com> (raw)
In-Reply-To: <20080331.195323.83430743.yoshfuji@linux-ipv6.org>

YOSHIFUJI Hideaki / 吉藤英明 said the following on 2008-3-31 18:53:
>>>> Check length of setsockopt's optval, which provided by user, before copy it
>>>> from user space.
>>> Please use "<" not "==".
>>>
>> There are two reasons that why I only check whether
>> len of optval is equal to that one in user space.
>> 1. We currently copy the entire structure from user
>>    to kernel.
>> 2. In other cases, such as IPV6_LEAVE/JOIN_ANYCAST,
>>    we check whether the len is equal to struct's len.
>>
>> So, Yoshifuji-san, can you tell me more about why we
>> should use "<"? :)
> 
> POSIX, as we have some comments in that file ;-).
> If it is shorter than expected, -EINVAL, otherwise, no error.
> We need to fix other sites as well.
> 

ooh, I see.
I will take a business trip to Japan tomorrow and I will finish
this patch since I come back weekend.
Thank you for your explanation.

--WCN


  reply	other threads:[~2008-03-31 11:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-31  9:08 [2.6 PATCH] IPV6: Check length of optval provided by user in setsockopt() Wang Chen
2008-03-31  9:15 ` YOSHIFUJI Hideaki / 吉藤英明
2008-03-31 10:46   ` Wang Chen
2008-03-31 10:53     ` YOSHIFUJI Hideaki / 吉藤英明
2008-03-31 11:04       ` Wang Chen [this message]
2008-04-07  1:42       ` Wang Chen
2008-04-11  7:15         ` YOSHIFUJI Hideaki / 吉藤英明

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=47F0C556.8090109@cn.fujitsu.com \
    --to=wangchen@cn.fujitsu.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.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).