On Fri, Jun 04, 2004 at 08:07:25PM +1000, Herbert Xu wrote:
> On Thu, May 06, 2004 at 08:15:15PM +1000, herbert wrote:
> > 
> > The current code is applying the maxusage limit to GUSAGE/SUSAGE.  This
> > is incorrect as the number of values is stored in field->report_count,
> > not field->maxusage.  The USB phone from www.virbiage.com is one device
> > where report_count exceeds maxusage.
> 
> I've remove the changes unrelated to the boundary check.  Please let me
> know if you have any problems with this patch.

Thanks, applied.

> ===== drivers/usb/input/hiddev.c 1.49 vs edited =====
> --- 1.49/drivers/usb/input/hiddev.c   2004-05-29 07:08:23 +10:00
> +++ edited/drivers/usb/input/hiddev.c 2004-06-04 20:02:29 +10:00
> @@ -638,15 +638,18 @@
>                               goto inval;
>  
>                       field = report->field[uref->field_index];
> -                     if (uref->usage_index >= field->maxusage)
> -                             goto inval;
> -
> -                     if (cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) {
> -                             if (uref_multi->num_values >= HID_MAX_USAGES || 
> -                                 uref->usage_index >= field->maxusage || 
> -                                (uref->usage_index + uref_multi->num_values) >= 
> field->maxusage)
> +                     if (cmd == HIDIOCGCOLLECTIONINDEX) {
> +                             if (uref->usage_index >= field->maxusage)
>                                       goto inval;
> -                     }
> +                     } else if (uref->usage_index >= field->report_count)
> +                             goto inval;
> +                     else if ((cmd == HIDIOCGUSAGES ||
> +                               cmd == HIDIOCSUSAGES) &&
> +                              (uref->usage_index + uref_multi->num_values >=
> +                               field->report_count ||
> +                               uref->usage_index + uref_multi->num_values <
> +                               uref->usage_index))
> +                             goto inval;
>               }
>  
>               switch (cmd) {


-- 
Vojtech Pavlik
SuSE Labs, SuSE CR


-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to