linux/drivers
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
..
accessibility
acpi PCI changes for the v3.10 merge window: 2013-04-29 09:30:25 -07:00
amba
ata Char / Misc driver update for 3.10-rc1 2013-04-29 11:18:34 -07:00
atm
auxdisplay
base numa, cpu hotplug: change links of CPU and node when changing node number by onlining CPU 2013-04-29 15:54:39 -07:00
bcma
block Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client 2013-04-17 12:52:02 -07:00
bluetooth Merge v3.9-rc5 into char-misc-next 2013-04-01 10:50:58 -07:00
bus Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
cdrom
char Char / Misc driver update for 3.10-rc1 2013-04-29 11:18:34 -07:00
clk clk: tegra: Allow PLLE training to succeed 2013-04-01 11:44:38 -07:00
clocksource
connector
cpufreq cpufreq / intel_pstate: Set timer timeout correctly 2013-04-08 22:09:23 +02:00
cpuidle
crypto crypto: ux500 - add missing comma 2013-04-05 21:02:17 +08:00
dca
devfreq
dio
dma dmaengine: at_hdmac: fix race condition in atc_advance_work() 2013-04-18 08:54:22 -07:00
edac
eisa PCI changes for the v3.10 merge window: 2013-04-29 09:30:25 -07:00
extcon This is small fixes for extcon driver. 2013-04-08 16:50:23 -07:00
firewire
firmware firmware, memmap: fix firmware_map_entry leak 2013-04-29 15:54:38 -07:00
gpio These are the pinctrl changes for v3.10: 2013-04-29 09:40:35 -07:00
gpu Merge branch '3.10/fb-mmap' into for-next 2013-04-26 09:14:47 +03:00
hid Merge 3.9-rc6 into usb-next 2013-04-08 08:36:40 -07:00
hsi
hv Drivers: hv: vmbus: Fix a bug in hv_need_to_signal() 2013-04-01 12:29:52 -07:00
hwmon Staging driver tree update for 3.10-rc1 2013-04-29 11:34:17 -07:00
hwspinlock hwspinlock: fix __hwspin_lock_request error path 2013-04-05 17:45:11 +03:00
i2c ACPI / I2C: Use parent's ACPI_HANDLE() in acpi_i2c_register_devices() 2013-04-02 15:30:41 +02:00
ide
idle
iio iio: at91_adc: fix missing Sample and Hold time 2013-04-02 19:22:16 +01:00
infiniband firmware,IB/qib: revert firmware file move 2013-04-05 12:19:39 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2013-04-19 09:15:13 -07:00
iommu PCI changes for the v3.10 merge window: 2013-04-29 09:30:25 -07:00
ipack
irqchip irqchip: gic: fix irq_trigger return 2013-03-26 20:52:25 +01:00
isdn TTY/Serial driver update for 3.10-rc1 2013-04-29 12:16:17 -07:00
leds
lguest
macintosh Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2013-02-23 17:09:55 -08:00
mailbox
md Revert "block: add missing block_bio_complete() tracepoint" 2013-04-18 09:00:26 -07:00
media media: coda: use genalloc API 2013-04-29 18:28:13 -07:00
memory memory: emif: Load the correct custom config values from dt 2013-03-25 13:18:13 -07:00
memstick
message
mfd extcon: arizona: Updates for v3.10 2013-04-03 11:28:18 -07:00
misc misc: generic on-chip SRAM allocation driver 2013-04-29 18:28:13 -07:00
mmc TTY/Serial driver update for 3.10-rc1 2013-04-29 12:16:17 -07:00
mtd mtdchar: remove no-longer-used vma helpers 2013-04-19 10:05:39 -07:00
net USB patches for 3.10-rc1 2013-04-29 12:19:23 -07:00
nfc NFC: microread: Fix build failure due to a new MEI bus API 2013-04-01 00:52:42 +02:00
ntb NTB: Fix Sparse Warnings 2013-01-21 14:34:21 -08:00
nubus
of
oprofile
parisc
parport parport: use kmemdup instead of kmalloc + memcpy 2013-03-25 10:42:06 -07:00
pci PCI changes for the v3.10 merge window: 2013-04-29 09:30:25 -07:00
pcmcia
pinctrl pinctrl: move subsystem mutex to pinctrl_dev struct 2013-04-26 17:01:35 +02:00
platform Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86 2013-04-18 15:14:34 -07:00
pnp
power
pps
ps3
ptp
pwm
rapidio Driver core updates for 3.8-rc1 2012-12-11 13:13:55 -08:00
regulator
remoteproc remoteproc: fix FW_CONFIG typo 2013-04-07 15:11:27 +03:00
rpmsg drivers/rpmsg/virtio_rpmsg_bus.c: fix error return code in rpmsg_probe() 2013-04-29 18:28:13 -07:00
rtc drivers/rtc/rtc-ds1307.c: long block operations bugfix 2013-04-29 18:28:28 -07:00
s390 TTY/Serial driver update for 3.10-rc1 2013-04-29 12:16:17 -07:00
sbus bbc_i2c: fix section mismatch warning 2013-03-31 19:29:12 -04:00
scsi PCI changes for the v3.10 merge window: 2013-04-29 09:30:25 -07:00
sfi
sh
sn
spi spi: Fixes for v3.9 2013-04-05 10:04:41 -07:00
ssb ssb: implement spurious tone avoidance 2013-04-10 10:31:26 -04:00
ssbi SSBI: Remove MSM_ prefix from SSBI drivers 2013-03-25 10:39:40 -07:00
staging TTY/Serial driver update for 3.10-rc1 2013-04-29 12:16:17 -07:00
target target: Fix incorrect fallthrough of ALUA Standby/Offline/Transition CDBs 2013-04-11 01:48:49 -07:00
tc
thermal
tty TTY/Serial driver update for 3.10-rc1 2013-04-29 12:16:17 -07:00
uio drivers: uio: Fix UIO device registration failure 2013-03-29 09:08:22 -07:00
usb USB patches for 3.10-rc1 2013-04-29 12:19:23 -07:00
uwb
vfio PCI changes for the v3.10 merge window: 2013-04-29 09:30:25 -07:00
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2013-04-12 15:26:42 -07:00
video drivers/video/backlight/tps65217_bl.c add default brightness value option 2013-04-29 18:28:19 -07:00
virt
virtio
vlynq
vme
w1 ASoC/extcon: arizona: Fix interaction between HPDET and headphone outputs 2013-03-26 09:19:02 -07:00
watchdog watchdog: Revert the AT91RM9200_WATCHDOG dependency 2013-04-14 09:09:10 +02:00
xen Features: 2013-04-29 08:16:51 -07:00
zorro
Kconfig add single-wire serial bus interface (SSBI) driver 2013-03-25 10:33:56 -07:00
Makefile USB patches for 3.10-rc1 2013-04-29 12:19:23 -07:00