Re: Proposed patch for cp210x: GPIO and USB descriptor control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 21, 2010 at 08:25:19AM -0600, Steve McKown wrote:
> Nice!  I think the data written to /sys/blah/blah/configuration should have a 
> magic string at the beginning and a CRC field at the end, so the driver can 
> validate the input.  This would prevent accidental writing of bad data to the 
> cp210x, and perhaps mitigate the need for the lock/unlock files.

I disagree here.  Adding the requirement for a header w/ magic string and
CRC means that, practically, you need a userspace library to use this
interface.

Maybe you need a "magic string" to unlock (instead of just "echo 1", you
could use "echo UnLockMe".  But the individual value fields should be
easily readable/writeable without hoops to jump through.

As for preventing "accidental writing of bad data" -- there are two parts
to this: "accidental writing" and "bad data".  "Accidental writing" is
easily solved with lock/unlock.  "Bad Data" can't be prevented, unless you
can validate the data somehow (which, in the case of VID/PID or strings,
you really can't do).

Thus, I think the lock/unlock paradigm works better here.

Matt


-- 
Matthew Dharm                              Home: mdharm-usb@xxxxxxxxxxxxxxxxxx 
Maintainer, Linux USB Mass Storage Driver

I'm just trying to think of a way to say "up yours" without getting fired.
					-- Stef
User Friendly, 10/8/1998

Attachment: pgphZGdZL8qfC.pgp
Description: PGP signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux