Hi Matthieu,
On Sat, 16 May 2009, matthieu castet wrote:
Hi,
dibusb_i2c_xfer seems to do things very dangerous :
it assumes that it get only write/read request or write request.
That means that read can be understood as write. For example a program
doing
file = open("/dev/i2c-x", O_RDWR);
ioctl(file, I2C_SLAVE, 0x50)
read(file, data, 10)
will corrupt the eeprom as it will be understood as a write.
I attach a possible (untested) patch.
Matthieu
Signed-off-by: Matthieu CASTET <[email protected]>
thanks a lot for your patch. I applied it, but could not test. But even
it is breaks things, it's better to prevent those "false-reads" than not
having this protection. Any breakage we will fix later.
Patrick.
--
Mail: [email protected]
WWW: http://www.wi-bw.tfh-wildau.de/~pboettch/
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html