1
0
Fork 0
alistair23-linux/drivers/staging
Piotr Sarna 02073798a6 staging: zcache: fix "zcache=" kernel parameter
Commit 835f2f5 ("staging: zcache: enable zcache to be built/loaded as
a module") introduced an incorrect handling of "zcache=" parameter.

Inside zcache_comp_init() function, zcache_comp_name variable is
checked for being empty. If not empty, the above variable is tested
for being compatible with Crypto API. Unfortunately, after that
function ends unconditionally (by the "goto out" directive) and returns:
- non-zero value if verification succeeded, wrongly indicating an error
- zero value if verification failed, falsely informing that function
  zcache_comp_init() ended properly.

A solution to this problem is as following:
1. Move the "goto out" directive inside the "if (!ret)" statement
2. In case that crypto_has_comp() returned 0, change the value of ret
   to non-zero before "goto out" to indicate an error.

This patch replaces an earlier one from Michal Hocko (based on report
from Cristian Rodriguez):

	http://permalink.gmane.org/gmane.linux.kernel.mm/102484

It also addressed the same issue but didn't fix the zcache_comp_init()
for case when the compressor data passed to "zcache=" option was invalid
or unsupported.

Signed-off-by: Piotr Sarna <p.sarna@partner.samsung.com>
[bzolnier: updated patch description]
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Cc: stable <stable@vger.kernel.org> # 3.10
Cc: Cristian Rodriguez <crrodriguez@opensuse.org>
Cc: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-29 11:45:09 -07:00
..
android staging: android: logger: Correct write offset reset on error 2013-07-23 15:08:50 -07:00
asus_oled staging/asus_oled fixed linebreak and printk issue 2013-06-05 15:29:07 -07:00
bcm
btmtk_usb staging: btmtk_usb: use GFP_KERNEL inplace of GFP_ATOMIC in _probe path 2013-06-03 12:35:53 -07:00
ced1401
comedi MAINTAINERS: Update the list of maintainers for staging/comedi driver. 2013-07-24 09:51:18 -07:00
cptm1217
crystalhd Staging: crystalhd: remove an unneeded NULL check 2013-06-03 12:26:18 -07:00
cxt1e1
dgrp drivers: avoid format string in dev_set_name 2013-07-03 16:07:41 -07:00
dwc2 staging: dwc2: fix thinko in dwc2_hc_set_even_odd_frame() 2013-06-24 15:56:10 -07:00
echo
et131x
frontier staging: frontier: use after free in disconnect() 2013-07-23 15:08:50 -07:00
ft1000 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-07-09 18:24:39 -07:00
fwserial IEEE 1394 (FireWire) subsystem changes post v3.10: 2013-07-10 11:02:58 -07:00
gdm72xx staging: gdm72xx: potential use after free in send_qos_list() 2013-07-23 15:08:50 -07:00
goldfish
iio iio staging: fix lis3l02dq, read error handling 2013-07-09 22:11:53 +01:00
imx-drm staging: drm/imx: drop "select OF_VIDEOMODE" 2013-07-23 15:08:50 -07:00
keucr staging: keucr: removed unnecessary variables and comments 2013-06-17 14:46:18 -07:00
line6 staging: line6: Fix unlocked snd_pcm_stop() call 2013-07-15 21:25:14 +02:00
lustre mode_t whack-a-mole... 2013-07-06 23:04:23 +04:00
media Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2013-07-13 12:09:57 -07:00
netlogic staging: netlogic: Fix typo in staging/netlogic 2013-06-24 15:56:09 -07:00
nvec staging: nvec: move device tree parsing to its own function 2013-06-24 15:59:03 -07:00
octeon MIPS: OCTEON: Rename Kconfig CAVIUM_OCTEON_REFERENCE_BOARD to CAVIUM_OCTEON_SOC 2013-06-10 18:01:25 +02:00
octeon-usb staging: octeon-usb: octeon-hcd: eliminate printk()s 2013-06-18 11:17:04 -07:00
olpc_dcon
ozwpan staging: ozwpan: remove event tracing code. 2013-06-17 14:48:12 -07:00
panel
phison
quickstart
rtl8187se staging/rtl8187se: Convert __list_for_each use to list_for_each 2013-06-18 11:22:58 -07:00
rtl8192e
rtl8192u Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-07-09 18:24:39 -07:00
rtl8712 drivers: avoid parsing names as kthread_run() format strings 2013-07-03 16:07:41 -07:00
rts5139 staging: rts5139: Use correct USB transfer interval to fix syslog spamming 2013-06-03 12:15:34 -07:00
sb105x
sbe-2t3e3
sep
serqt_usb2 Staging tree merge for 3.11-rc1 2013-07-02 11:40:23 -07:00
silicom Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-07-09 18:24:39 -07:00
slicoss
sm7xxfb
speakup
ste_rmi4
tidspbridge staging: tidspbridge: replace strict_strtol() with kstrtos32() 2013-07-24 09:51:18 -07:00
usbip
vme
vt6655 Staging: vt6655: aes_ccmp: fixed a brace coding style 2013-06-24 15:57:40 -07:00
vt6656 staging: vt6656: mac.c MACvDisableKeyEntry remove dead code wOffset 2013-06-17 14:55:32 -07:00
winbond Staging: winbond: Check for unsuccessful allocation immediately 2013-06-03 12:32:00 -07:00
wlags49_h2
wlags49_h25
wlan-ng
xgifb
zcache staging: zcache: fix "zcache=" kernel parameter 2013-07-29 11:45:09 -07:00
zram staging: zram: protect zram_reset_device() call 2013-07-23 15:08:50 -07:00
zsmalloc
Kconfig staging: csr: remove driver 2013-07-16 22:37:09 -07:00
Makefile staging: csr: remove driver 2013-07-16 22:37:09 -07:00
staging.c