linux/drivers/rtc
Bertrand Achard bc48b9023b drivers/rtc/rtc-ds1307.c: long block operations bugfix
The rtc-ds1307 driver does not properly handle block operations bigger
than 32 bytes in either of the two modes supported (SMbus native, or
emulated if not supported by the SMbus platform driver).

It also does not properly handle userland-supplied input (block
operation length) through sysfs and may suffer a type of buffer overrun.

The driver has been modified with proper input validation, buffer sizes,
and now splits block transfers bigger than 32 bytes into separate
transfers.

Explanation : Buffer size allocated is I2C_SMBUS_BLOCK_MAX which equals
to 32 as per the SMbus spec.  Reads and write may be up to 56 bytes (to
the NVRAM).  This patch allocated a 255 byte buffer, the maximum
allowable (address is an u8).  It's not only a buffer problem, SMbus
only supports up to 32 bytes transfer at once, so it's needed to split
bigger transfers.

Patch successfully tested on 3.2.27; cleanly applies on 3.7-rc4.

[akpm@linux-foundation.org: rework code to avoid 80-column overflows]
Signed-off-by: Bertrand Achard <ba@cykian.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-04-29 18:28:28 -07:00
..
class.c drivers/rtc/class.c: use struct device as the first argument for devm_rtc_device_register() 2013-04-29 18:28:22 -07:00
hctosys.c rtc_sysfs_show_hctosys(): display 0 if resume failed 2012-10-06 03:05:04 +09:00
interface.c driver-core: constify data for class_find_device() 2013-02-06 12:18:56 -08:00
Kconfig This is the MFD pull request for the 3.9 merge window. 2013-02-24 20:00:58 -08:00
Makefile This is the MFD pull request for the 3.9 merge window. 2013-02-24 20:00:58 -08:00
rtc-88pm80x.c rtc: rtc-88pm80x: use devm_rtc_device_register() 2013-04-29 18:28:24 -07:00
rtc-88pm860x.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-ab3100.c rtc: rtc-ab3100: use module_platform_driver_probe() 2013-04-29 18:28:22 -07:00
rtc-ab8500.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-at32ap700x.c rtc: rtc-at32ap700x: use module_platform_driver_probe() 2013-04-29 18:28:22 -07:00
rtc-at91rm9200.c rtc: rtc-at91rm9200: use module_platform_driver_probe() 2013-04-29 18:28:22 -07:00
rtc-at91rm9200.h Revert "drivers/rtc/rtc-at91rm9200.c: use a variable for storing IMR" 2013-04-05 09:36:53 -07:00
rtc-at91sam9.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-au1xxx.c rtc: rtc-au1xxx: use module_platform_driver_probe() 2013-04-29 18:28:22 -07:00
rtc-bfin.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-bq32k.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-bq4802.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-cmos.c rtc: rtc-cmos: use dev_warn()/dev_dbg() instead of printk()/pr_debug() 2013-02-21 17:22:29 -08:00
rtc-coh901331.c rtc: rtc-coh90133: use devm_rtc_device_register() 2013-04-29 18:28:25 -07:00
rtc-core.h
rtc-da9052.c rtc: rtc-da9052: use devm_rtc_device_register() 2013-04-29 18:28:25 -07:00
rtc-da9055.c rtc: rtc-da9055: use devm_rtc_device_register() 2013-04-29 18:28:25 -07:00
rtc-davinci.c rtc: rtc-davinci: use devm_rtc_device_register() 2013-04-29 18:28:25 -07:00
rtc-dev.c rtc: use dev_warn()/dev_dbg()/pr_err() instead of printk() 2013-02-21 17:22:29 -08:00
rtc-dm355evm.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-ds1216.c
rtc-ds1286.c drivers/rtc/rtc-ds1286.c: fix compiler warning while doing make W=1 2013-04-29 18:28:28 -07:00
rtc-ds1302.c rtc: rtc-ds1302: use module_platform_driver_probe() 2013-04-29 18:28:23 -07:00
rtc-ds1305.c drivers/rtc: dump small buffers via %*ph 2013-02-21 17:22:27 -08:00
rtc-ds1307.c drivers/rtc/rtc-ds1307.c: long block operations bugfix 2013-04-29 18:28:28 -07:00
rtc-ds1374.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-ds1390.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-ds1511.c rtc: rtc-ds1511: use devm_rtc_device_register() 2013-04-29 18:28:25 -07:00
rtc-ds1553.c rtc: rtc-ds1553: use devm_rtc_device_register() 2013-04-29 18:28:25 -07:00
rtc-ds1672.c drivers/rtc/rtc-ds1672.c: convert struct i2c_msg initialization to C99 format 2012-10-06 03:05:05 +09:00
rtc-ds1742.c rtc: rtc-ds1742: use devm_rtc_device_register() 2013-04-29 18:28:25 -07:00
rtc-ds2404.c rtc: rtc-ds2404: use dev_err() instead of printk() 2013-02-21 17:22:29 -08:00
rtc-ds3232.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-ds3234.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-efi.c rtc: rtc-efi: use module_platform_driver_probe() 2013-04-29 18:28:23 -07:00
rtc-em3027.c drivers/rtc/rtc-em3027.c: convert struct i2c_msg initialization to C99 format 2012-10-06 03:05:07 +09:00
rtc-ep93xx.c rtc: rtc-ep93xx: use devm_rtc_device_register() 2013-04-29 18:28:25 -07:00
rtc-fm3130.c drivers/rtc: dump small buffers via %*ph 2013-02-21 17:22:27 -08:00
rtc-generic.c rtc: rtc-generic: use module_platform_driver_probe() 2013-04-29 18:28:23 -07:00
rtc-hid-sensor-time.c rtc: hid-sensor-time: Add missing spin_lock_init 2013-01-26 10:07:52 +00:00
rtc-imxdi.c rtc: rtc-imxdi: use devm_rtc_device_register() 2013-04-29 18:28:25 -07:00
rtc-isl1208.c drivers/rtc/rtc-isl1208.c: call rtc_update_irq() from the alarm irq handler 2013-02-05 20:38:49 +11:00
rtc-isl12022.c drivers/rtc: remove unnecessary semicolons 2013-02-21 17:22:27 -08:00
rtc-jz4740.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-lib.c
rtc-lp8788.c rtc: rtc-lp8788: use devm_rtc_device_register() 2013-04-29 18:28:26 -07:00
rtc-lpc32xx.c rtc: rtc-lpc32xx: use devm_rtc_device_register() 2013-04-29 18:28:26 -07:00
rtc-ls1x.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-m41t80.c drivers/rtc/rtc-m41t80.c: remove disabled alarm functionality 2012-10-06 03:05:07 +09:00
rtc-m41t93.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-m41t94.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-m48t35.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-m48t59.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-m48t86.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-max6900.c rtc: convert rtc i2c drivers to module_i2c_driver 2012-03-23 16:58:39 -07:00
rtc-max6902.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-max8907.c rtc: rtc-max8907: use devm_rtc_device_register() 2013-04-29 18:28:26 -07:00
rtc-max8925.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-max8997.c rtc: rtc-max8997: use devm_rtc_device_register() 2013-04-29 18:28:26 -07:00
rtc-max8998.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-max77686.c rtc: rtc-max77686: use devm_rtc_device_register() 2013-04-29 18:28:26 -07:00
rtc-mc13xxx.c rtc: rtc-mc13xxx: use module_platform_driver_probe() 2013-04-29 18:28:23 -07:00
rtc-mpc5121.c drivers/rtc: use of_match_ptr() macro 2013-02-21 17:22:27 -08:00
rtc-mrst.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-msm6242.c rtc: rtc-msm6242: use module_platform_driver_probe() 2013-04-29 18:28:23 -07:00
rtc-mv.c rtc: rtc-mv: use devm_rtc_device_register() 2013-04-29 18:28:26 -07:00
rtc-mxc.c rtc: rtc-mxc: use devm_rtc_device_register() 2013-04-29 18:28:26 -07:00
rtc-nuc900.c rtc: rtc-nuc900: use module_platform_driver_probe() 2013-04-29 18:28:23 -07:00
rtc-omap.c rtc: rtc-omap: use module_platform_driver_probe() 2013-04-29 18:28:23 -07:00
rtc-palmas.c rtc: rtc-palmas: use devm_rtc_device_register() and devm_request_threaded_irq() 2013-04-29 18:28:26 -07:00
rtc-pcap.c rtc: rtc-pcap: use module_platform_driver_probe() 2013-04-29 18:28:23 -07:00
rtc-pcf2123.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-pcf8523.c rtc: rtc-pcf8523: use devm_rtc_device_register() 2013-04-29 18:28:26 -07:00
rtc-pcf8563.c drivers/rtc: remove unnecessary semicolons 2013-02-21 17:22:27 -08:00
rtc-pcf8583.c rtc: rtc-pcf8583: use dev_warn() instead of printk() 2013-02-21 17:22:29 -08:00
rtc-pcf50633.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-pl030.c Merge branch 'amba' of git://git.linaro.org/people/rmk/linux-arm 2012-03-23 17:36:29 -07:00
rtc-pl031.c drivers/rtc/rtc-pl031.c: add wakeup support 2013-02-21 17:22:28 -08:00
rtc-pm8xxx.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-proc.c rtc-proc: permit the /proc/driver/rtc device to use other devices 2012-10-06 03:05:01 +09:00
rtc-ps3.c rtc: rtc-ps3: use module_platform_driver_probe() 2013-04-29 18:28:24 -07:00
rtc-puv3.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-pxa.c rtc: rtc-pxa: use module_platform_driver_probe() 2013-04-29 18:28:24 -07:00
rtc-r9701.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-rc5t583.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-rp5c01.c rtc: rtc-rp5c01: use module_platform_driver_probe() 2013-04-29 18:28:24 -07:00
rtc-rs5c313.c rtc: rtc-rs5c313: use pr_err() instead of printk() 2013-02-21 17:22:29 -08:00
rtc-rs5c348.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-rs5c372.c rtc: rtc-rs5c372: use dev_dbg()/dev_warn() instead of printk()/pr_debug() 2013-02-21 17:22:29 -08:00
rtc-rv3029c2.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-rx4581.c rtc: add support for spi rtc rx4581 2013-02-21 17:22:28 -08:00
rtc-rx8025.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-rx8581.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-s3c.c rtc: rtc-s3c: use devm_rtc_device_register() 2013-04-29 18:28:27 -07:00
rtc-s35390a.c drivers/rtc/rtc-s35390a.c: add wakealarm support for rtc-s35390A rtc chip 2012-10-06 03:05:08 +09:00
rtc-sa1100.c drivers/rtc/rtc-sa1100.c: move clock enable/disable to probe/remove 2013-02-21 17:22:28 -08:00
rtc-sh.c rtc: rtc-sh: use module_platform_driver_probe() 2013-04-29 18:28:24 -07:00
rtc-snvs.c rtc: rtc-snvs: use devm_rtc_device_register() 2013-04-29 18:28:27 -07:00
rtc-spear.c rtc: rtc-spear: use devm_rtc_device_register() 2013-04-29 18:28:27 -07:00
rtc-starfire.c rtc: rtc-starfire: use module_platform_driver_probe() 2013-04-29 18:28:24 -07:00
rtc-stk17ta8.c rtc: rtc-stk17ta8: use devm_rtc_device_register() 2013-04-29 18:28:27 -07:00
rtc-stmp3xxx.c rtc: stmp3xxx: add wdt-accessor function 2013-03-01 12:40:36 +01:00
rtc-sun4v.c rtc: rtc-sun4v: use module_platform_driver_probe() 2013-04-29 18:28:24 -07:00
rtc-sysfs.c rtc_sysfs_show_hctosys(): display 0 if resume failed 2012-10-06 03:05:04 +09:00
rtc-tegra.c drivers/rtc/rtc-tegra.c: use managed rtc_device_register() 2013-04-29 18:28:28 -07:00
rtc-test.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-tile.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-tps6586x.c rtc: rtc-tps6586x: use devm_rtc_device_register() 2013-04-29 18:28:27 -07:00
rtc-tps65910.c rtc: rtc-tps65910: use devm_rtc_device_register() 2013-04-29 18:28:27 -07:00
rtc-tps80031.c rtc: rtc-tps80031: use devm_rtc_device_register() 2013-04-29 18:28:27 -07:00
rtc-twl.c drivers/rtc: use of_match_ptr() macro 2013-02-21 17:22:27 -08:00
rtc-tx4939.c rtc: rtc-tx4939: use devm_rtc_device_register() 2013-04-29 18:28:27 -07:00
rtc-v3020.c
rtc-vr41xx.c rtc: rtc-vr41xx: use dev_info() instead of printk() 2013-02-21 17:22:29 -08:00
rtc-vt8500.c rtc: rtc-vt8500: use devm_rtc_device_register() 2013-04-29 18:28:27 -07:00
rtc-wm831x.c rtc: rtc-wm831x: use devm_rtc_device_register() 2013-04-29 18:28:27 -07:00
rtc-wm8350.c Drivers: rtc: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
rtc-x1205.c drivers/rtc/rtc-x1205.c: convert struct i2c_msg initialization to C99 format 2012-10-06 03:05:05 +09:00
systohc.c NTP: Add a CONFIG_RTC_SYSTOHC configuration 2013-01-15 18:16:06 -08:00