lkml.org 
[lkml]   [2014]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] usb: serial: Perform verification for FTDI FT232R devices
On 23/10/14 23:14, Russ Dill wrote:
> On Thu, Oct 23, 2014 at 5:44 AM, Hector Martin <hector@marcansoft.com> wrote:
>> + write_eeprom(port, 0, eeprom_data[0]);
>> + write_eeprom(port, 1, 0);
>> + write_eeprom(port, eeprom_size - 2, eeprom_data[eeprom_size - 2]);
>> + write_eeprom(port, eeprom_size - 1, checksum);
>
> Damned off by one errors. Yes, it should be the product ID, not the
> vendor ID. These write u16's though, writing to wIndex 2 writes to
> bytes 4 and 5. the correct code is:
>
> write_eeprom(port, 2, 0);
> write_eeprom(port, eeprom_size - 2, checksum);
>
> And yes, the checksum code needs to be modified to create a specially
> crafted value that allows the existing checksum to pass.

Oh, I thought/assumed that the switch to VID and the real checksum was a
deliberate attempt at perversing the original code into something that
bricks even real FTDIs :-) (In which case all you'd need to add is the
two extra dummy writes, to load the proper data into the buffer register
on a real FT232RL to prevent it from corrupting the adjacent EEPROM words).

--
Hector Martin (hector@marcansoft.com)
Public Key: http://www.marcansoft.com/marcan.asc



\
 
 \ /
  Last update: 2014-10-23 19:41    [W:0.187 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site