[ECOS] bug in eth_drv_send (memory overwrite)

Deak, Ferenc ferenc.deak@stp.hu
Wed Jan 18 14:42:00 GMT 2006


> 
> But the check is made *after* the list length has been incremented.  It
> is valid for sg_len to be equal to MAX_ETH_DRV_SG at this point.

Put a line 
  if (sg_len == MAX_ETH_DRV_SG) diag_print("ARRAY OVERWRITE\n");
after writing sg_list.

exactly:

693: 	sg_list[sg_len].buf = (CYG_ADDRESS)data;
694: 	sg_list[sg_len].len = len;		// !!!!!! largest sg_len here is MAX_ETH_DRV_SG
new:		if (sg_len == MAX_ETH_DRV_SG) diag_print("ARRAY OVERWRITE\n");
 
Sorry if I'm wrong.



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list