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 18:46:25 +0800	[thread overview]
Message-ID: <47F0C101.9090302@cn.fujitsu.com> (raw)
In-Reply-To: <20080331.181551.118587102.yoshfuji@linux-ipv6.org>

YOSHIFUJI Hideaki / 吉藤英明 said the following on 2008-3-31 17:15:
> In article <47F0AA16.1070900@cn.fujitsu.com> (at Mon, 31 Mar 2008 17:08:38 +0800), Wang Chen <wangchen@cn.fujitsu.com> says:
> 
>> 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 "<"? :)

--WCN


  reply	other threads:[~2008-03-31 10:47 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 [this message]
2008-03-31 10:53     ` YOSHIFUJI Hideaki / 吉藤英明
2008-03-31 11:04       ` Wang Chen
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=47F0C101.9090302@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).