All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hector Martin <hector@marcansoft.com>
To: Russ Dill <russ.dill@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] usb: serial: Perform verification for FTDI FT232R devices
Date: Fri, 24 Oct 2014 02:05:32 +0900	[thread overview]
Message-ID: <5449355C.2060301@marcansoft.com> (raw)
In-Reply-To: <CA+Bv8XbpqJZiKFA2PsY7DFMcGxzG=bfZv5oR45k2gx7rQivLGA@mail.gmail.com>

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


  reply	other threads:[~2014-10-23 17:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23 12:44 [PATCH] usb: serial: Perform verification for FTDI FT232R devices Hector Martin
2014-10-23 14:14 ` Russ Dill
2014-10-23 17:05   ` Hector Martin [this message]
2014-10-23 19:41     ` [PATCH v2] " Russ Dill
2014-10-23 19:53       ` John Stoffel
2014-10-24  6:22   ` [PATCH] " Perry Hung
  -- strict thread matches above, loose matches on Subject: below --
2014-10-23  8:52 russ.dill
2014-10-23  9:40 ` Greg KH
2014-10-23  9:53   ` Frans Klaver
2014-10-23 11:18   ` One Thousand Gnomes
2014-10-23 11:19     ` Johan Hovold
2014-10-23 12:55     ` Mark Brown
2014-10-27 10:58 ` Oliver Neukum
2014-10-27 11:09 ` Oliver Neukum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5449355C.2060301@marcansoft.com \
    --to=hector@marcansoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=russ.dill@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.