In article <[EMAIL PROTECTED]> (at Wed, 25 Jan 2006 19:46:07 -0800), "Kris 
Katterjohn" <[EMAIL PROTECTED]> says:

> @@ -1399,6 +1423,17 @@ static int packet_getsockopt(struct sock
>               return -EINVAL;
>               
>       switch(optname) {
> +     case PACKET_ACCUMULATE_STATISTICS:
> +     {
> +             if (len < sizeof(po->accumulate_stats))
> +                     return -EINVAL;
> +             if (len > sizeof(po->accumulate_stats))
> +                     len = sizeof(po->accumulate_stats);
> +             if (copy_to_user(optval, &po->accumulate_stats, len))
> +                     return -EFAULT;
> +             break;
> +     }
> +

For getsockopt(), you need to truncate the value instead of returning -EINVAL
if optlen len is not enough.  Thus, remove
"if (len < sizeof(po->accumulate_stats)) return -EINVAL;".

Thanks.

--yoshfuji
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to