* [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
@ 2009-01-13 7:35 Yang Hongyang
2009-01-14 3:47 ` Herbert Xu
0 siblings, 1 reply; 18+ messages in thread
From: Yang Hongyang @ 2009-01-13 7:35 UTC (permalink / raw)
To: netdev, David Miller
Actually the condition (optlen == 0) is included in (optlen < sizeof(struct in6_pktinfo)),
so we do not need to check it separately.
Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com>
---
net/ipv6/ipv6_sockglue.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 40f3246..e6affa7 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -399,9 +399,7 @@ sticky_done:
{
struct in6_pktinfo pkt;
- if (optlen == 0)
- goto e_inval;
- else if (optlen < sizeof(struct in6_pktinfo) || optval == NULL)
+ if (optlen < sizeof(struct in6_pktinfo) || optval == NULL)
goto e_inval;
if (copy_from_user(&pkt, optval, sizeof(struct in6_pktinfo))) {
--
1.6.0.3
--
Regards
Yang Hongyang
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
2009-01-13 7:35 [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option Yang Hongyang
@ 2009-01-14 3:47 ` Herbert Xu
2009-01-14 3:54 ` Yang Hongyang
0 siblings, 1 reply; 18+ messages in thread
From: Herbert Xu @ 2009-01-14 3:47 UTC (permalink / raw)
To: Yang Hongyang; +Cc: netdev, davem
Yang Hongyang <yanghy@cn.fujitsu.com> wrote:
> Actually the condition (optlen == 0) is included in (optlen < sizeof(struct in6_pktinfo)),
> so we do not need to check it separately.
You don't need to check optval == NULL either since that's the
job of copy_from_user.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
2009-01-14 3:47 ` Herbert Xu
@ 2009-01-14 3:54 ` Yang Hongyang
2009-01-14 4:07 ` Wei Yongjun
2009-01-14 4:48 ` [PATCH]IPv6:remove duplicate check of optlen " Herbert Xu
0 siblings, 2 replies; 18+ messages in thread
From: Yang Hongyang @ 2009-01-14 3:54 UTC (permalink / raw)
To: Herbert Xu; +Cc: netdev, davem
Herbert Xu wrote:
> Yang Hongyang <yanghy@cn.fujitsu.com> wrote:
>> Actually the condition (optlen == 0) is included in (optlen < sizeof(struct in6_pktinfo)),
>> so we do not need to check it separately.
>
> You don't need to check optval == NULL either since that's the
> job of copy_from_user.
If optval==NULL, what we should return?EINVAL or EFAULT?
If it is EINVAL,then we should check it .otherwise it's the job of
copy_from_user
>
> Cheers,
--
Regards
Yang Hongyang
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
2009-01-14 3:54 ` Yang Hongyang
@ 2009-01-14 4:07 ` Wei Yongjun
2009-01-14 5:27 ` Yang Hongyang
2009-01-14 4:48 ` [PATCH]IPv6:remove duplicate check of optlen " Herbert Xu
1 sibling, 1 reply; 18+ messages in thread
From: Wei Yongjun @ 2009-01-14 4:07 UTC (permalink / raw)
To: Yang Hongyang; +Cc: Herbert Xu, netdev, davem
Yang Hongyang wrote:
> Herbert Xu wrote:
>
>> Yang Hongyang <yanghy@cn.fujitsu.com> wrote:
>>
>>> Actually the condition (optlen == 0) is included in (optlen < sizeof(struct in6_pktinfo)),
>>> so we do not need to check it separately.
>>>
>> You don't need to check optval == NULL either since that's the
>> job of copy_from_user.
>>
>
> If optval==NULL, what we should return?EINVAL or EFAULT?
> If it is EINVAL,then we should check it .otherwise it's the job of
> copy_from_user
>
I think if optval==NULL, the in6_pktinfo which is set should be remove.
So, you should handle optval==NULL. Not just return error.
>
>> Cheers,
>>
>
>
>
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
2009-01-14 3:54 ` Yang Hongyang
2009-01-14 4:07 ` Wei Yongjun
@ 2009-01-14 4:48 ` Herbert Xu
2009-01-15 5:02 ` David Miller
1 sibling, 1 reply; 18+ messages in thread
From: Herbert Xu @ 2009-01-14 4:48 UTC (permalink / raw)
To: Yang Hongyang; +Cc: netdev, davem
Yang Hongyang <yanghy@cn.fujitsu.com> wrote:
>
> If optval==NULL, what we should return?EINVAL or EFAULT?
> If it is EINVAL,then we should check it .otherwise it's the job of
> copy_from_user
I think EFAULT is fine. We return that elsewhere as well.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
2009-01-14 4:07 ` Wei Yongjun
@ 2009-01-14 5:27 ` Yang Hongyang
2009-01-14 8:26 ` Shan Wei
0 siblings, 1 reply; 18+ messages in thread
From: Yang Hongyang @ 2009-01-14 5:27 UTC (permalink / raw)
To: Wei Yongjun; +Cc: Herbert Xu, netdev, davem
Wei Yongjun wrote:
> Yang Hongyang wrote:
>> Herbert Xu wrote:
>>
>>> Yang Hongyang <yanghy@cn.fujitsu.com> wrote:
>>>
>>>> Actually the condition (optlen == 0) is included in (optlen <
>>>> sizeof(struct in6_pktinfo)),
>>>> so we do not need to check it separately.
>>>>
>>> You don't need to check optval == NULL either since that's the
>>> job of copy_from_user.
>>>
>>
>> If optval==NULL, what we should return?EINVAL or EFAULT?
>> If it is EINVAL,then we should check it .otherwise it's the job of
>> copy_from_user
>>
>
> I think if optval==NULL, the in6_pktinfo which is set should be remove.
> So, you should handle optval==NULL. Not just return error.
There's no RFC defines the behavior above,but:
RFC3542 said The application can remove any sticky Routing header or sticky
Destination options header or sticky Hop-by-Hop options header by calling
setsockopt() with a zero option length.
So,do we need to allow remove any sticky pktinfo option by calling
setsockopt() with a zero option length?
>
>>
>>> Cheers,
>>>
>>
>>
>>
>
>
>
--
Regards
Yang Hongyang
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
2009-01-14 5:27 ` Yang Hongyang
@ 2009-01-14 8:26 ` Shan Wei
2009-01-15 0:50 ` [PATCHv2]IPv6:remove duplicate check " Yang Hongyang
0 siblings, 1 reply; 18+ messages in thread
From: Shan Wei @ 2009-01-14 8:26 UTC (permalink / raw)
To: Yang Hongyang; +Cc: Wei Yongjun, Herbert Xu, netdev, davem
Yang Hongyang said:
> Wei Yongjun wrote:
>> Yang Hongyang wrote:
>>> Herbert Xu wrote:
>>>
>>>> Yang Hongyang <yanghy@cn.fujitsu.com> wrote:
>>>>
>>>>> Actually the condition (optlen == 0) is included in (optlen <
>>>>> sizeof(struct in6_pktinfo)),
>>>>> so we do not need to check it separately.
>>>>>
>>>> You don't need to check optval == NULL either since that's the
>>>> job of copy_from_user.
>>>>
>>> If optval==NULL, what we should return?EINVAL or EFAULT?
>>> If it is EINVAL,then we should check it .otherwise it's the job of
>>> copy_from_user
>>>
>> I think if optval==NULL, the in6_pktinfo which is set should be remove.
>> So, you should handle optval==NULL. Not just return error.
>
> There's no RFC defines the behavior above,but:
> RFC3542 said The application can remove any sticky Routing header or sticky
> Destination options header or sticky Hop-by-Hop options header by calling
> setsockopt() with a zero option length.
>
> So,do we need to allow remove any sticky pktinfo option by calling
> setsockopt() with a zero option length?
>
Can remove the option using seting in6_pktinfo struct wiht
ipi6_ifindex=0,ipi6_ifindex=IN6ADDR_ANY_INIT.
If no RFC definition, not to reset with optlen=0,
for example IPV6_TCLASS, PV6_2292DSTOPTS.
--
Best Regards
Shan Wei
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCHv2]IPv6:remove duplicate check when setsockopt with IPV6_PKTINFO option
2009-01-14 8:26 ` Shan Wei
@ 2009-01-15 0:50 ` Yang Hongyang
0 siblings, 0 replies; 18+ messages in thread
From: Yang Hongyang @ 2009-01-15 0:50 UTC (permalink / raw)
To: Herbert Xu, davem; +Cc: Shan Wei, Wei Yongjun, netdev
Actually the condition (optlen == 0) is included in (optlen < sizeof(struct in6_pktinfo)),
so we do not need to check it separately.
We don't need to check (optval==NULL) either,because copy_from_user() will do the job.
Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com>
---
net/ipv6/ipv6_sockglue.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 40f3246..1c203b6 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -399,9 +399,7 @@ sticky_done:
{
struct in6_pktinfo pkt;
- if (optlen == 0)
- goto e_inval;
- else if (optlen < sizeof(struct in6_pktinfo) || optval == NULL)
+ if (optlen < sizeof(struct in6_pktinfo))
goto e_inval;
if (copy_from_user(&pkt, optval, sizeof(struct in6_pktinfo))) {
--
1.6.0.3
Shan Wei wrote:
> Yang Hongyang said:
>> Wei Yongjun wrote:
>>> Yang Hongyang wrote:
>>>> Herbert Xu wrote:
>>>>
>>>>> Yang Hongyang <yanghy@cn.fujitsu.com> wrote:
>>>>>
>>>>>> Actually the condition (optlen == 0) is included in (optlen <
>>>>>> sizeof(struct in6_pktinfo)),
>>>>>> so we do not need to check it separately.
>>>>>>
>>>>> You don't need to check optval == NULL either since that's the
>>>>> job of copy_from_user.
>>>>>
>>>> If optval==NULL, what we should return?EINVAL or EFAULT?
>>>> If it is EINVAL,then we should check it .otherwise it's the job of
>>>> copy_from_user
>>>>
>>> I think if optval==NULL, the in6_pktinfo which is set should be remove.
>>> So, you should handle optval==NULL. Not just return error.
>> There's no RFC defines the behavior above,but:
>> RFC3542 said The application can remove any sticky Routing header or sticky
>> Destination options header or sticky Hop-by-Hop options header by calling
>> setsockopt() with a zero option length.
>>
>> So,do we need to allow remove any sticky pktinfo option by calling
>> setsockopt() with a zero option length?
>>
>
> Can remove the option using seting in6_pktinfo struct wiht
> ipi6_ifindex=0,ipi6_ifindex=IN6ADDR_ANY_INIT.
>
> If no RFC definition, not to reset with optlen=0,
> for example IPV6_TCLASS, PV6_2292DSTOPTS.
>
--
Regards
Yang Hongyang
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
2009-01-14 4:48 ` [PATCH]IPv6:remove duplicate check of optlen " Herbert Xu
@ 2009-01-15 5:02 ` David Miller
2009-01-15 5:04 ` Herbert Xu
2009-01-15 5:34 ` Yang Hongyang
0 siblings, 2 replies; 18+ messages in thread
From: David Miller @ 2009-01-15 5:02 UTC (permalink / raw)
To: herbert; +Cc: yanghy, netdev
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Wed, 14 Jan 2009 15:48:56 +1100
> Yang Hongyang <yanghy@cn.fujitsu.com> wrote:
> >
> > If optval==NULL, what we should return?EINVAL or EFAULT?
> > If it is EINVAL,then we should check it .otherwise it's the job of
> > copy_from_user
>
> I think EFAULT is fine. We return that elsewhere as well.
Actually, we return EINVAL just a few lines above this code
block for some other socket option cases when optval==NULL.
So for consistency I'm applying Yang's original patch to
net-next-2.6
Thanks.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
2009-01-15 5:02 ` David Miller
@ 2009-01-15 5:04 ` Herbert Xu
2009-01-15 5:06 ` Herbert Xu
2009-01-15 5:43 ` David Miller
2009-01-15 5:34 ` Yang Hongyang
1 sibling, 2 replies; 18+ messages in thread
From: Herbert Xu @ 2009-01-15 5:04 UTC (permalink / raw)
To: David Miller; +Cc: yanghy, netdev
On Wed, Jan 14, 2009 at 09:02:42PM -0800, David Miller wrote:
>
> Actually, we return EINVAL just a few lines above this code
> block for some other socket option cases when optval==NULL.
Well the very next option IPV6_2292PKTOPTIONS returns EFAULT
by virtue of not explicitly checking optval == NULL :)
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
2009-01-15 5:04 ` Herbert Xu
@ 2009-01-15 5:06 ` Herbert Xu
2009-01-15 5:25 ` Yang Hongyang
2009-01-15 5:43 ` David Miller
1 sibling, 1 reply; 18+ messages in thread
From: Herbert Xu @ 2009-01-15 5:06 UTC (permalink / raw)
To: David Miller; +Cc: yanghy, netdev
On Thu, Jan 15, 2009 at 04:04:49PM +1100, Herbert Xu wrote:
> On Wed, Jan 14, 2009 at 09:02:42PM -0800, David Miller wrote:
> >
> > Actually, we return EINVAL just a few lines above this code
> > block for some other socket option cases when optval==NULL.
>
> Well the very next option IPV6_2292PKTOPTIONS returns EFAULT
> by virtue of not explicitly checking optval == NULL :)
In fact checking for a NULL pointer is strictly speaking wrong
since NULL may actually have been mapped in user-space :)
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
2009-01-15 5:06 ` Herbert Xu
@ 2009-01-15 5:25 ` Yang Hongyang
0 siblings, 0 replies; 18+ messages in thread
From: Yang Hongyang @ 2009-01-15 5:25 UTC (permalink / raw)
To: Herbert Xu; +Cc: David Miller, netdev
Herbert Xu wrote:
> On Thu, Jan 15, 2009 at 04:04:49PM +1100, Herbert Xu wrote:
>> On Wed, Jan 14, 2009 at 09:02:42PM -0800, David Miller wrote:
>>> Actually, we return EINVAL just a few lines above this code
>>> block for some other socket option cases when optval==NULL.
>> Well the very next option IPV6_2292PKTOPTIONS returns EFAULT
>> by virtue of not explicitly checking optval == NULL :)
>
> In fact checking for a NULL pointer is strictly speaking wrong
> since NULL may actually have been mapped in user-space :)
But there are some cases that user-space passes a NULL pointer
to the kernel,Otherwise,copy_from_user needn't to cheak the
NULL pointer either.:)
By the way,I think most part of the ipv6 socket option implementation
are kind of ugly:)
>
> Cheers,
--
Regards
Yang Hongyang
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
2009-01-15 5:02 ` David Miller
2009-01-15 5:04 ` Herbert Xu
@ 2009-01-15 5:34 ` Yang Hongyang
2009-01-15 5:37 ` Herbert Xu
1 sibling, 1 reply; 18+ messages in thread
From: Yang Hongyang @ 2009-01-15 5:34 UTC (permalink / raw)
To: David Miller; +Cc: herbert, netdev
David Miller wrote:
> From: Herbert Xu <herbert@gondor.apana.org.au>
> Date: Wed, 14 Jan 2009 15:48:56 +1100
>
>> Yang Hongyang <yanghy@cn.fujitsu.com> wrote:
>>> If optval==NULL, what we should return?EINVAL or EFAULT?
>>> If it is EINVAL,then we should check it .otherwise it's the job of
>>> copy_from_user
>> I think EFAULT is fine. We return that elsewhere as well.
>
> Actually, we return EINVAL just a few lines above this code
> block for some other socket option cases when optval==NULL.
>
> So for consistency I'm applying Yang's original patch to
> net-next-2.6
Dave,there are some of the code elsewhere return EFAULT when
optval=NULL,I will post a patch to fix them:)
>
> Thanks.
>
>
--
Regards
Yang Hongyang
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
2009-01-15 5:34 ` Yang Hongyang
@ 2009-01-15 5:37 ` Herbert Xu
2009-01-15 5:45 ` David Miller
0 siblings, 1 reply; 18+ messages in thread
From: Herbert Xu @ 2009-01-15 5:37 UTC (permalink / raw)
To: Yang Hongyang; +Cc: David Miller, netdev
On Thu, Jan 15, 2009 at 01:34:03PM +0800, Yang Hongyang wrote:
>
> Dave,there are some of the code elsewhere return EFAULT when
> optval=NULL,I will post a patch to fix them:)
I disagree. The concept of a user-space NULL pointer is different
to that of a kernel-space NULL pointer, so the kernel should not
be treating a user-space NULL pointer differently than any other
pointer.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
2009-01-15 5:04 ` Herbert Xu
2009-01-15 5:06 ` Herbert Xu
@ 2009-01-15 5:43 ` David Miller
1 sibling, 0 replies; 18+ messages in thread
From: David Miller @ 2009-01-15 5:43 UTC (permalink / raw)
To: herbert; +Cc: yanghy, netdev
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu, 15 Jan 2009 16:04:49 +1100
> On Wed, Jan 14, 2009 at 09:02:42PM -0800, David Miller wrote:
> >
> > Actually, we return EINVAL just a few lines above this code
> > block for some other socket option cases when optval==NULL.
>
> Well the very next option IPV6_2292PKTOPTIONS returns EFAULT
> by virtue of not explicitly checking optval == NULL :)
Touche' :-)
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
2009-01-15 5:37 ` Herbert Xu
@ 2009-01-15 5:45 ` David Miller
2009-01-15 5:48 ` Herbert Xu
2009-01-15 10:07 ` Yang Hongyang
0 siblings, 2 replies; 18+ messages in thread
From: David Miller @ 2009-01-15 5:45 UTC (permalink / raw)
To: herbert; +Cc: yanghy, netdev
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu, 15 Jan 2009 16:37:02 +1100
> On Thu, Jan 15, 2009 at 01:34:03PM +0800, Yang Hongyang wrote:
> >
> > Dave,there are some of the code elsewhere return EFAULT when
> > optval=NULL,I will post a patch to fix them:)
>
> I disagree. The concept of a user-space NULL pointer is different
> to that of a kernel-space NULL pointer, so the kernel should not
> be treating a user-space NULL pointer differently than any other
> pointer.
I agree with Herbert, but of course we have to adhere to cases
where APIs actually define a user NULL pointer to have a specific
meaning.
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
2009-01-15 5:45 ` David Miller
@ 2009-01-15 5:48 ` Herbert Xu
2009-01-15 10:07 ` Yang Hongyang
1 sibling, 0 replies; 18+ messages in thread
From: Herbert Xu @ 2009-01-15 5:48 UTC (permalink / raw)
To: David Miller; +Cc: yanghy, netdev
On Wed, Jan 14, 2009 at 09:45:21PM -0800, David Miller wrote:
>
> I agree with Herbert, but of course we have to adhere to cases
> where APIs actually define a user NULL pointer to have a specific
> meaning.
Absolutely. Although AFAIK the relevant RFCs here only use the
notion of a zero option length for such purposes rather than
NULL pointers (presumably because the meaning of NULL pointers
are context dependent).
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option
2009-01-15 5:45 ` David Miller
2009-01-15 5:48 ` Herbert Xu
@ 2009-01-15 10:07 ` Yang Hongyang
1 sibling, 0 replies; 18+ messages in thread
From: Yang Hongyang @ 2009-01-15 10:07 UTC (permalink / raw)
To: David Miller; +Cc: herbert, netdev
David Miller wrote:
> From: Herbert Xu <herbert@gondor.apana.org.au>
> Date: Thu, 15 Jan 2009 16:37:02 +1100
>
>> On Thu, Jan 15, 2009 at 01:34:03PM +0800, Yang Hongyang wrote:
>>> Dave,there are some of the code elsewhere return EFAULT when
>>> optval=NULL,I will post a patch to fix them:)
>> I disagree. The concept of a user-space NULL pointer is different
>> to that of a kernel-space NULL pointer, so the kernel should not
>> be treating a user-space NULL pointer differently than any other
>> pointer.
>
> I agree with Herbert, but of course we have to adhere to cases
> where APIs actually define a user NULL pointer to have a specific
> meaning.
>
>
Agreed.Seems that Patch v2 is correct according to the discussion.^_^
--
Regards
Yang Hongyang
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2009-01-15 10:07 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-13 7:35 [PATCH]IPv6:remove duplicate check of optlen when setsockopt with IPV6_PKTINFO option Yang Hongyang
2009-01-14 3:47 ` Herbert Xu
2009-01-14 3:54 ` Yang Hongyang
2009-01-14 4:07 ` Wei Yongjun
2009-01-14 5:27 ` Yang Hongyang
2009-01-14 8:26 ` Shan Wei
2009-01-15 0:50 ` [PATCHv2]IPv6:remove duplicate check " Yang Hongyang
2009-01-14 4:48 ` [PATCH]IPv6:remove duplicate check of optlen " Herbert Xu
2009-01-15 5:02 ` David Miller
2009-01-15 5:04 ` Herbert Xu
2009-01-15 5:06 ` Herbert Xu
2009-01-15 5:25 ` Yang Hongyang
2009-01-15 5:43 ` David Miller
2009-01-15 5:34 ` Yang Hongyang
2009-01-15 5:37 ` Herbert Xu
2009-01-15 5:45 ` David Miller
2009-01-15 5:48 ` Herbert Xu
2009-01-15 10:07 ` Yang Hongyang
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).