[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20111221.144126.2213051521357190879.davem@davemloft.net>
Date: Wed, 21 Dec 2011 14:41:26 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: xi.wang@...il.com, therbert@...gle.com, netdev@...r.kernel.org
Subject: Re: [PATCH] rps: fix insufficient bounds checking in
store_rps_dev_flow_table_cnt()
From: Eric Dumazet <eric.dumazet@...il.com>
Date: Wed, 21 Dec 2011 20:22:24 +0100
> Le mercredi 21 décembre 2011 à 13:50 -0500, Xi Wang a écrit :
>> @@ -665,7 +665,7 @@ static ssize_t store_rps_dev_flow_table_cnt(struct netdev_rx_queue *queue,
>> if (count) {
>> int i;
>>
>> - if (count > 1<<30) {
>> + if (count > 1<<28) {
>> /* Enforce a limit to prevent overflow */
>> return -EINVAL;
>> }
>
>
> Really, you should remove this magic number and use instead
>
> (INT_MAX - RPS_DEV_FLOW_TABLE_SIZE(0)) / sizeof(struct rps_dev_flow)
>
> Or something like that, because next time we add a field in
> rps_dev_flow, test will be obsolete.
Agreed.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists