[linux-dvb] [PATCH] DIBUSB_MC : fix i2c to not corrupt eeprom in case of strange read pattern

matthieu castet castet.matthieu at free.fr
Sat May 16 15:08:29 CEST 2009


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
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.


Signed-off-by: Matthieu CASTET <castet.matthieu at free.fr>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dibusb_i2c
Url: http://www.linuxtv.org/pipermail/linux-dvb/attachments/20090516/948eff6c/attachment.txt 

More information about the linux-dvb mailing list