android_kernel_google_msm/drivers
Mikulas Patocka d8b8a43e0f dm: fix truncated status strings
commit fd7c092e71 upstream.

Avoid returning a truncated table or status string instead of setting
the DM_BUFFER_FULL_FLAG when the last target of a table fills the
buffer.

When processing a table or status request, the function retrieve_status
calls ti->type->status. If ti->type->status returns non-zero,
retrieve_status assumes that the buffer overflowed and sets
DM_BUFFER_FULL_FLAG.

However, targets don't return non-zero values from their status method
on overflow. Most targets returns always zero.

If a buffer overflow happens in a target that is not the last in the
table, it gets noticed during the next iteration of the loop in
retrieve_status; but if a buffer overflow happens in the last target, it
goes unnoticed and erroneously truncated data is returned.

In the current code, the targets behave in the following way:
* dm-crypt returns -ENOMEM if there is not enough space to store the
  key, but it returns 0 on all other overflows.
* dm-thin returns errors from the status method if a disk error happened.
  This is incorrect because retrieve_status doesn't check the error
  code, it assumes that all non-zero values mean buffer overflow.
* all the other targets always return 0.

This patch changes the ti->type->status function to return void (because
most targets don't use the return code). Overflow is detected in
retrieve_status: if the status method fills up the remaining space
completely, it is assumed that buffer overflow happened.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-08 07:29:43 -08:00
..
accessibility
acpi ACPICA: Fix for a Store->ArgX when ArgX contains a reference to a field. 2013-11-29 10:50:31 -08:00
amba
ata ahci: add Marvell 9230 to the AHCI PCI device list 2013-12-04 10:50:22 -08:00
atm atm: idt77252: fix dev refcnt leak 2013-12-08 07:29:42 -08:00
auxdisplay
base drivers/base/memory.c: fix show_mem_removable() to handle missing sections 2013-09-07 21:58:14 -07:00
bcma
block xen/blkback: fix reference counting 2013-12-04 10:50:30 -08:00
bluetooth Bluetooth: Add support for Dell[QCA 0cf3:817a] 2013-04-05 10:04:15 -07:00
cdrom drivers/cdrom/cdrom.c: use kzalloc() for failing hardware 2013-07-13 11:03:40 -07:00
char random: run random_int_secret_init() run after all late_initcalls 2013-10-22 09:02:25 +01:00
clk clk: remove notifier from list before freeing it 2013-06-27 11:27:30 -07:00
clocksource
connector connector: improved unaligned access error fix 2013-12-08 07:29:41 -08:00
cpufreq cpufreq / Longhaul: Disable driver by default 2013-05-11 13:48:10 -07:00
cpuidle
crypto
dca dca: check against empty dca_domains list before unregister provider 2013-02-28 06:59:06 -08:00
devfreq
dio
dma dmaengine: imx-dma: fix slow path issue in prep_dma_cyclic 2013-10-13 15:42:49 -07:00
edac
eisa EISA/PCI: Fix bus res reference 2013-04-12 09:38:44 -07:00
firewire firewire: fix libdc1394/FlyCap2 iso event regression 2013-08-04 16:26:02 +08:00
firmware efivars: Handle duplicate names from get_next_variable() 2013-04-05 10:04:36 -07:00
gpio
gpu radeon: workaround pinning failure on low ram gpu 2013-12-04 10:50:33 -08:00
hid HID: picolcd_core: validate output report details 2013-12-08 07:29:42 -08:00
hsi
hv
hwmon hwmon: (lm90) Fix max6696 alarm handling 2013-11-29 10:50:35 -08:00
hwspinlock hwspinlock: fix __hwspin_lock_request error path 2013-04-12 09:38:46 -07:00
i2c i2c: designware: always clear interrupts before enabling them 2013-05-24 11:14:22 -07:00
ide
idle
ieee802154
infiniband IB/ipath: Convert ipath_user_sdma_pin_pages() to use get_user_pages_fast() 2013-12-04 10:50:28 -08:00
input Input: i8042 - add PNP modaliases 2013-12-04 10:50:34 -08:00
iommu iommu/vt-d: Fixed interaction of VFIO_IOMMU_MAP_DMA with IOMMU address limits 2013-12-08 07:29:43 -08:00
isdn net: rework recvmsg handler msg_name and msg_namelen logic 2013-12-08 07:29:41 -08:00
leds drivers/leds/leds-ot200.c: fix error caused by shifted mask 2013-06-07 12:49:13 -07:00
lguest
macintosh
mca
md dm: fix truncated status strings 2013-12-08 07:29:43 -08:00
media media: mantis: fix silly crash case 2013-05-24 11:14:23 -07:00
memstick
message
mfd mfd: adp5520: Restore mode bits on resume 2013-05-07 19:51:57 -07:00
misc
mmc mmc: block: fix a bug of error handling in MMC driver 2013-12-08 07:29:42 -08:00
mtd mtd: gpmi: fix kernel BUG due to racing DMA operations 2013-12-04 10:50:29 -08:00
net net: rework recvmsg handler msg_name and msg_namelen logic 2013-12-08 07:29:41 -08:00
nfc
nubus
of of: Fix missing memory initialization on FDT unflattening 2013-09-26 17:15:51 -07:00
oprofile
parisc
parport
pci PCI: Remove duplicate pci_disable_device() from pcie_portdrv_remove() 2013-12-04 10:50:32 -08:00
pcmcia pcmcia: at91_cf: fix gpio_get_value in at91_cf_get_status 2013-07-21 18:19:01 -07:00
pinctrl
platform thinkpad-acpi: recognize latest V-Series using DMI_BIOS_VENDOR 2013-06-07 12:49:49 -07:00
pnp
power charger-manager: Ensure event is not used as format string 2013-07-13 11:03:40 -07:00
pps
ps3
ptp
rapidio
regulator
remoteproc
rpmsg
rtc drivers/rtc/rtc-rv3029c2.c: fix disabling AIE irq 2013-07-21 18:19:01 -07:00
s390 qeth: avoid buffer overflow in snmp ioctl 2013-12-04 10:50:30 -08:00
sbus
scsi aacraid: prevent invalid pointer dereference 2013-11-29 10:50:30 -08:00
sfi
sh
sn
spi spi/mpc512x-psc: optionally keep PSC SS asserted across xfer segmensts 2013-04-12 09:38:43 -07:00
ssb ssb: implement spurious tone avoidance 2013-04-25 21:19:55 -07:00
staging media: lirc_zilog: Don't use dynamic static allocation 2013-12-04 10:50:35 -08:00
target iscsi-target: chap auth shouldn't match username with trailing garbage 2013-12-04 10:50:28 -08:00
tc
thermal thermal: return an error on failure to register thermal class 2013-04-12 09:38:47 -07:00
tty powerpc/hvsi: Increase handshake timeout from 200ms to 400ms. 2013-09-07 21:58:14 -07:00
uio Fix a few incorrectly checked [io_]remap_pfn_range() calls 2013-11-29 10:50:32 -08:00
usb USB: mos7840: fix tiocmget error handling 2013-11-29 10:50:32 -08:00
uwb
vhost vhost: zerocopy: poll vq in zerocopy callback 2013-09-14 06:02:10 -07:00
video video: kyro: fix incorrect sizes when copying to userspace 2013-12-08 07:29:43 -08:00
virt
virtio virtio: support unlocked queue poll 2013-08-04 16:26:03 +08:00
vlynq
w1 w1: fix oops when w1_search is called from netlink connector 2013-03-20 13:04:59 -07:00
watchdog watchdog: ts72xx_wdt: locking bug in ioctl 2013-10-22 09:02:25 +01:00
xen xen-gnt: prevent adding duplicate gnt callbacks 2013-09-26 17:15:30 -07:00
zorro
Kconfig
Makefile